TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   XHTML, HTML, CSS (http://www.talkphp.com/xhtml-html-css/)
-   -   CSS and if statements (http://www.talkphp.com/xhtml-html-css/3100-css-if-statements.html)

delayedinsanity 07-10-2008 10:10 PM

CSS and if statements
 
Does anybody know much about CSS and conditional statements?

I have the following fixes in my CSS;

Code:

<!--[if IE 5]>
img, div {behavior: url('iepngfix.htc');}
<![endif]-->
<!--[if lt IE 7 ]>
body {behavior:url('csshover.htc');}
<![endif]-->

The first is obviously the IE pngfix, the second being the Internet Explorer :hover pseudo class fix. Now when I put these at the top of my global.css it breaks my layout in FF3. When I place it at the bottom, it doesn't. Why this is? I'm not sure and would be curious to know, especially since I don't have pre IE 7 to test either of the fixes locally to see if they're even working properly.
-m

wGEric 07-10-2008 10:55 PM

Those need to go in the HTML and not the CSS. You may need to do it outside of the <style> tag. I'm not sure on that.

delayedinsanity 07-10-2008 11:20 PM

Outside the style? Ahh, okay I've never used conditionals in my CSS before, but I love png, and I just built a style set that uses :hover on elements other than A, so I figured why not give it a go.

Got it fixed, I placed the fixes in their own stylesheet and added the following to my html;

Code:

<!--[if lt IE 7 ]>
<link href="/bin/exploder.css" rel="stylesheet" type="text/css" media="screen" />
<![endif]-->

...and done. Thanks again,
-m


All times are GMT. The time now is 01:30 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0