Forum Moderators: not2easy
a page calls a style sheet via link href, styleA.css
styleA.css imports styleB.css: @import "styleB.css";
they both have the same class in their respective stylesheets...
in styleA.css we have:
.maincolleft {
width: 239px;
margin: 0;
padding: 0 0 15px 0;
float: left;
}
.maincolright {
width: 300px;
}
in the imported stylesheet styleB.css we have:
.maincolleft, .maincolright {
width: 244px;
}
which will take effect and overide the other?
[w3.org...]
Note it changed from the CSS2 version referenced above.
Basically the standard doesn't make a difference between the different author stylesheets in the cascade.
It the specificity makes the @import more specific, it wins.
If the specificity doesn't make a difference, that only leaves source order: which is coming first will loose out, and since your @import has to come at the top of the css file ... there is no chance the @import should win.
See point 4 in [w3.org...]
But I'd be careful relying on such things, you never know how a browser crafter interpreted things ... or if they even bothered to follow the standard.