I have this in my print CSS:
.foo
{
display: none;
}
.bar
{
display: none;
}
All class="foo"
elements are hidden, but all class="bar"
elements are still visible. What could be the cause of this?
I have this in my print CSS:
.foo
{
display: none;
}
.bar
{
display: none;
}
All class="foo"
elements are hidden, but all class="bar"
elements are still visible. What could be the cause of this?
CSS specificity could be overruling your print CSS rules. The simplest way to resolve this is to add !important
to your rules. While generally this should be avoided, it's fine to use it in a print CSS.
.bar
{
display: none !important;
}
The other way is to make sure your print CSS rules come out on top in the specificity calculation. The exact way to do this depends entirely on your regular CSS rules.