Is it possible in CSS to override a property if that property doesn't have a default value?
For example, say your primary stylesheet defines a border for a particular element:
#element {
border: 1px solid #000;
}
If you wanted to disable the border from a secondary stylesheet, you could do this:
#element {
border: none;
}
Assuming the secondary stylesheet was loaded after the primary one, the border: none
rule would take precedence and remove the border.
But what if you were trying to override a property that doesn't have a default or null value?
#element {
position: absolute;
left: 0;
}
Now say, in your secondary stylesheet, you wanted to do this:
#element {
right: 0;
top: 0;
}
And you didn't want any value for left
. There's no such thing as left: none;
, so...how do you "undeclare" the left
property assigned in the primary stylesheet?