views:

10183

answers:

4

I want to Target with CSS valid code. to IE7 and IE8, Please Give me some Information about this Issue and CSS code should be W3C Valid. IE8 is here. Some time we fix for IE7 but not work in IE8.

+2  A: 

Well you don't really have to worry about IE7 code not working in IE8 because IE8 has compatibility mode (it can render pages the same as IE7). But if you still want to target different versions of IE, a way that's been done for a while now is to either use conditional comments or begin your css rule with a * to target IE7 and below. Or you could pay attention to user agent on the servers and dish up a different CSS file based on that information.

apphacker
Thanks.. but using * hack is Not valid W3C CSS . so it might be Problem. and Conditional comment is Useful solution. but It Create much larger version of HTML file.. so might be We create Diff CSS. like IE7.css , Is there any conditional comment for IE8.Once again thansk Apphacker
Wazdesign
+6  A: 

I would recommend looking into conditional comments and making a separate sheet for the IEs you are having problems with.

 <!--[if IE 7]>
   <link rel="stylesheet" type="text/css" href="ie7.css" />
 <![endif]-->
scragar
+1  A: 

The most relavant information on IE explorer css bugs can be found at www.quirksmode.org

superUntitled
+2  A: 

The actual problem is not IE8, but the hacks that you use for earlier versions of IE.

IE8 is pretty close to be standards compliant, so you shouldn't need any hacks at all for it, perhaps only some tweaks. The problem is if you are using some hacks for IE6 and IE7; you will have to make sure that they only apply to those versions and not IE8.

I made the web site of our company compatible with IE8 a while ago. The only thing that I actually changed was adding the meta tag that tells IE that the pages are IE8 compliant...

Guffa
Oh,, sounds Good. Can you please let Us know.. what META tag.
Wazdesign
The X-UA-Compatible meta tag: http://msdn.microsoft.com/en-gb/library/cc817574.aspx
Guffa
Thanks a lot Guffa
Wazdesign