user188962
user188962

Reputation:

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{
  float:left;
}

#elem1, #elem2 h2{
  font-size:20px;
}

I wonder if this is supported by major browsers, even IE6?

Upvotes: 0

Views: 42

Answers (2)

Andreas Eriksson
Andreas Eriksson

Reputation: 9027

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.

Upvotes: 0

Jamie Dixon
Jamie Dixon

Reputation: 54021

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.

Upvotes: 2

Related Questions