0

Is there a way to set CSS by @media for one specific resolution only? Not from-to px, but only for one specific number. This doesn't work:

@media (min-width: 767px) and (max-width: 767px) {
    #sp-logo {width: 33.33333333%;}
}

Neither works this:

@media (width: 767px) {
    #sp-logo {width: 33.33333333%;}
}

When I cover two or more pixels, it suddenly works. But that's not what I need. Example:

@media (min-width: 767px) and (max-width: 768px) {
    #sp-logo {width: 33.33333333%;}
}
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62

1 Answers1

0

Your first code snippet works fine with every other number of pixels. Its just a bug with 767px for max-width. So if you need it exactly for that number the trick is a point number (almost 768):

@media (min-width: 767px) and (max-width: 767.9px) {
    #sp-logo {width: 33.33333333%;}
}
biberman
  • 5,606
  • 4
  • 11
  • 35