Hi there.
I need to hide background images of different sections on a single page, at different viewport widths. For example I need .x-bg-layer-upper-image
for Section 1 to hide at 768 pixels and lower, while Section 2 needs to hide it at 980 pixels and lower.
I created two classes - nobg768 and nobg980 - and added the class declarations to the appropriate sections.
The CSS looks like this:
@media (max-width: 768px) {
.nobg768 .x-bg-layer-upper-image {
background-image: none !important;
}
}
@media (max-width: 980px) {
.nobg980 .x-bg-layer-upper-image {
background-image: none !important;
}
}
My issue is that the section with the class nobg980 hides the background image at the same viewport width as the section with the nobg768 class. However if i set the second CSS media width to any value lower than 768px, it works.
Clearly I’m doing something wrong. Can you please point me in the right direction?
Thanks in advance!