Search This Blog

Saturday, April 11, 2009

css hacks for IE

While writing XHTML/CSS we might have faced the problem of browser compatibility. Following are some ways to solve these issues in IE browsers

In IE 6 series before a class or ID specify *html

Eg . if your class name is .content then you write

*html .content { … }

If it is an id you can write it as below

*html #content { …. }

In IE 7 series inside the class or ID you write # before each element

Eg.

.content { margin:3px; #margin:4px }

Here in IE 7 browsers margin will take 4px where in other browsers it will take 3px

No comments: