Media Query syntax error when compressing code

Asked

Viewed 20 times

0

I am trying to compress the site where I work to the maximum and I am minimizing the Java and css, but this giving error to minify the css well in the codes similar to what I will put here below. He validates the syntax and he considers this statement of Media Query within the main class as a syntax error, it even works and lets go, but when compressing and playing on the server it gives problem. Does anyone know why this happens and how to solve?

Follow an example:

.img-header-home-01 {

background-image: url("../imagens/home/slider-01.jpg");
background-size: cover;
background-attachment: scroll;
background-position: center center;

@media (max-width: @iphone-screen) {
    background-attachment: scroll;
}

}

  • Have you tried using the value of iphone-screen direct on px or rem?

1 answer

0


I changed your syntax a little and it worked! Follow the example:

.img-header-home-01 {

background-image: url("../imagens/home/slider-01.jpg");
background-size: cover;
background-attachment: scroll;
background-position: center center;

}

@media (max-width: @iphone-screen) {
    .img-header-home-01 {
         background-attachment: scroll;
    }
}

And pissed would look like this:

.img-header-home-01{background-image:url(../imagens/home/slider-01.jpg);background-size:cover;background-attachment:scroll;background-position:center center}@media (max-width:@iphone-screen){.img-header-home-01{background-attachment:scroll}}
  • That’s right. Thank you very much!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.