The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › CSS › how to specify css for IE6 and above
hi folks, need help.
i have created a page but now, it’s all working good with chrome and mozilla. but as the webpage is for college, the college uses IE7.
now, when i open the same page on IE 7, everything is messed up. specially the attributes, that i specified with %.
like i specified “margin-top:15%” it perfect in chrome but in IE it is like more than 20%.
how do i fix it ?
You can load an IE specific stylesheet after your main stylesheet. This way you can specify certain styles only for IE. You can do this using simple HTML to check to see if the website is IE or not.
The code below will check if it’s less than IE9, though you can change that to suit your needs.
I like to name my IE stylesheet ie.css. I also keep it in a folder called ‘css’ to clean up the root.
If you’re using IE10 then you won’t see the effects when using the code above, because it will only load for IE9 or lower.