Jump to content

pinchacas

Members
  • Posts

    2
  • Joined

  • Last visited

Posts posted by pinchacas

  1. 18 hours ago, dsonesuk said:

    What is wrong? You expected center center not to work in media query? You'd  be wrong, it would carry on from position styling from default non media query styling, as does background size, attachment and repeat. If you want to reset to default value use background-position: initial; in media query.

    background-position: initial; on @media work!

    U are amazing! Thank u! :)

  2. Hi everyone!

    I have a problem with background-position: center center; on @media only screen and (max-width: 600px)... if background-position: center center; is activated, @media not work for my...

    Look at: This work perfectly:

    <!DOCTYPE html>
    <html>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
    body {
        background-image: url(fondo.jpg);
        background-size: cover;
        background-repeat: no-repeat;
        background-attachment: fixed;
    }
    
    @media only screen and (max-width: 750px) {
      body {
        background-image: url(750.jpg);
    	background-size: cover;
        background-repeat: no-repeat;
        background-attachment: fixed;
      }
    }
    </style>
    </head>
    <body>
    
    </body>
    </html>

    But if write background-position: center center; @media not work:

    <!DOCTYPE html>
    <html>
    <head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
    body {
        background-image: url(fondo.jpg);
        background-size: cover;
        background-repeat: no-repeat;
        background-attachment: fixed;
        background-position: center center;
    }
    
    @media only screen and (max-width: 750px) {
      body {
        background-image: url(750.jpg);
    	background-size: cover;
        background-repeat: no-repeat;
        background-attachment: fixed;
      }
    }
    </style>
    </head>
    <body>
    
    </body>
    </html>

    Why???

    Help me please! Thx! 

     

×
×
  • Create New...