is there a background-color hack so IE will not understand?

liunx

Guest
is there a hack for IE so it will not apply the background-color?
something like b\ackground-color: #000 ?You shouldnt use "hacks" that rely on bugs in IE or any other browser. Use conditional comments instead to apply a different style sheet to IE only.

<!-- m --><a class="postlink" href="http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/overview/ccomment_ovw.asp">http://msdn.microsoft.com/library/defau ... nt_ovw.asp</a><!-- m -->

Main reason you shouldnt use them is because youre code should be forward compatable with IE7i know this way.
but i dont want to use it!
i just want to "eliminate" this background-color.
like using w\idthIf I understand you right, you want the background color to be different in interent explorer.

Embed your style sheets like this:


<link rel="stylesheet" type="text/css" href=http://www.webdeveloper.com/forum/archive/index.php/"style.css" />
<!--[if IE]>
<link rel="stylesheet" type="text/css" href=http://www.webdeveloper.com/forum/archive/index.php/"style_ie.css" />
<![endif]-->


Your style.css will contain:
background-color: #FF0000; /*Make the background red*/

Your style_ie.css file will contain:
background-color: #00FF00; /*Make the background green in internet explorer only*/Try the !important hack.

background-color: #000 !important;
background-color: transparent;thats not what i want... u give me solutions i allready know but dont want to use.

i m looking for something like this (<!-- m --><a class="postlink" href="http://centricle.com/ref/css/filters/tests/sbmh/">http://centricle.com/ref/css/filters/tests/sbmh/</a><!-- m -->) or this (<!-- m --><a class="postlink" href="http://centricle.com/ref/css/filters/">http://centricle.com/ref/css/filters/</a><!-- m -->) or those (<!-- m --><a class="postlink" href="http://css.maxdesign.com.au/listamatic/vertical18.htm">http://css.maxdesign.com.au/listamatic/vertical18.htm</a><!-- m -->)Ok, well maybe someone else will come along that can read your mind.Try the !important hack.

background-color: #000 !important;
background-color: transparent;

Just use this. IE7 will not understand !important from my understanding, and will continue to ignore it.<!-- m --><a class="postlink" href="http://www.webstandards.org/buzz/archive/2006_02.html#a000603ok">http://www.webstandards.org/buzz/archiv ... #a000603ok</a><!-- m --> then, i'll just use the html>body 'hack'Microsoft can rot.Don't use a hack at all. It is much better to do it with IE conditional statements.

<style>
body {background-color: #000;}
</style>
<!--[if IE]>
<style>
body {background-color" #f00;}
</style>
<![endif]-->Just use this. IE7 will not understand !important from my understanding, and will continue to ignore it.

The IE_7_beta version doesn't understand it, but according to this excerpt, the full-release (this Fall??), will understand it.

From the URL:
<!-- m --><a class="postlink" href="http://www.webstandards.org/buzz/archive/2006_02.html#a000603">http://www.webstandards.org/buzz/archiv ... ml#a000603</a><!-- m -->

The good news today is that the IE team has in fact fixed the way IE handles !important in all future builds beyond the IE7 Beta 2 Preview.

So worry not, my important friends, we'll soon have an IE that understands just how important !important is.

But conditional statements work and work reliably, so maybe just use that. :)There you go. Looks like the conditionals have it.
 
Back
Top