Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS [if IE7] in StyleSheet?

Can you define an [if IE7] in the actual stylesheet? Or must you do it in the html to pull a different SS?

Thanks! (Google isn't being kind to me =/)

like image 934
Ben Avatar asked Dec 30 '22 11:12

Ben


2 Answers

You will have to do that in the HTML code. The only way to do such a thing directly in CSS is by using certain CSS-Selectors, which only IE7 recognizes. If I'm not mistaken, that would be

*+html #yourselector {}

for IE7.

like image 192
fresskoma Avatar answered Jan 13 '23 13:01

fresskoma


You must do it in the HTML. There are various hacks to achieve similar behavior in CSS, but avoid them, as they may break in future browser versions.

like image 23
Ishmael Avatar answered Jan 13 '23 12:01

Ishmael