Is this way of declaring styles in stylesheets cross-browser compatible?
I am currently using this way of declaring multiple styles in a stylesheet:
#elem1, #elem2{
float:right;
}
.elem3, .elem4{
flo开发者_Go百科at:left;
}
#elem1, #elem2 h2{
font-size:20px;
}
I wonder if this is supported by major browsers, even IE6?
Yes, it sure is. This is a pretty standard way of declaring styles for multiple selectors and has been supported by all major browsers (even IE6) for a long time.
Yup. As far as I know, the place where IE6 caves is if you try to give a single HTML object multiple classes, where it will only read the last class and apply styles accordingly.
精彩评论