Discussion

Welcome to Absolute Web Dev Forum. Feel free to Register and ask me a question about web development or, if you can answer or contribute to the aswering of someones question, feel free to respond. All listings are reviewed by me so please make your comments usefull. If you will, please leave links to related websites or other references that someone can go to for further information on a given subject. Thank you for your contribution to Absolute Web Devs Web Forum.Create Discussion

How do I make css changes for Explorer only without JavaScript?

Chevy

How do I make css changes for Explorer only without JavaScript?   -   01/21/2009


I need to make a bunch of changes that apply to Internet Explorer only. How do I apply CSS to Explorer browsers and not have the other browsers like FireFox apply the changes as well. I really don’t want to use JavaScript either. Is there a way to do this?

WebMaster

Response   -   01/21/2009


Explorer supports special "IF" statements in the HTML comments. This is what it looks like:

<!--[if IE]>
<style>
p {
margin: 0px;
}
</style>
<![endif]-->

All paragraph tags in Internet Explorer will have the margin of 0 pixels with this comment in the head section. Hope this helps.

Add to this Discussion

Discussion Archive


TOP

  100% compatible with:
Firefox Explorer Opera Safari Flock Netscape Chrome

 100% valid CSS 3.0 and XHTML 1.0.
Valid CSS Valid XHTML