Jump to content

using style for IE only


Recommended Posts

My formatting renders fine in Opera and FF, but not in IE 7 (surprise, surprise, surprise). I need to add some padding for IE only. I know there's a way to hide styles from everything but IE using something like "if ie" in the stylesheet. But I can't remember the syntax and how to use it. I don't need the padding for any browser other than IE, so I want the line "padding-bottom: 10px;" line to only be picked up by IE and ignored by everyone else. Can someone please refresh my memory on this? I've tried to search the forum, but I can't find anything. :)

Link to comment
Share on other sites

<!--[if IE 7]>	   <style>	   /* Insert CSS Here */	   </style>	   <![endif]-->

I tried every variation I could think of. The padding I wanted for IE worked, but the rest of the style for that element is lost for all three browsers. There has to be a way other than using a script to check for what browser is being used and loading the appropriate stylesheet, isn't there?Here's the page: click here.Here's the CSS:
   .order-heading{	   font-family: 'Trebuchet MS',Verdana,Tahoma,Arial,'Arial Black',Helvetica,'Century Gothic','Lucida Sans Unicode',Impact,sans-serif;	   text-align: center;	   font-weight: 800;	   color: #660000;	   font-size: 16px;	   text-decoration: none;	   width: 100%;	 }	 	 .order-instructions{	   font-family: 'Comic Sans MS','Monotype Corsiva',cursive;	   font-style: italic;	   font-weight: 400;	   font-size: 13px;	   color: #660066;	   text-align: justify;	   text-decoration: none;	   margin: auto;	   width: 90%;	 }

The "order-heading" class is where I want to add "padding-bottom: 15px;" for IE only. FF & Opera render this just fine.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...