Jump to content


CSS problem


1 reply to this topic

#1 _*Creative Insanity_*

  • Guests

Posted 29 March 2007 - 11:05 PM

Hi
I have this in my xhtml file
<!--[if IE 6]>
<link href="css/ie.css" rel="stylesheet" type="text/css" />
<![endif]-->
<link href="css/style.css" rel="stylesheet" type="text/css" />

But when the bottom css file is linked the IE one is not used and IE displays crappy as it is getting the bottom one.
But if I remove the bottom one the IE one works.
I have tried placing the bottom link above and still does not work.
Is there a correct way of linking browser specific css files or am I just having a bad day. LOL

ta

#2 Stewie

    Young Padawan

  • Validating
  • Pip
  • 14 posts

Posted 30 March 2007 - 10:46 PM

you don't have to have different css files for different browsers, there are usually browser specific commands where you can just put all three, IE, opera, firefox, the best example I can think of is opacity

div.trans90 {
	width: 100%;
	opacity:.90;
	filter: alpha(opacity=90);
	-moz-opacity: 0.90;
}

the opacity:.90; is for opera
the filter: alpha(opacity=90); is for internet explorer;
the -moz-opacity: 0.90; is for firefox

When the browser reads the css file it finds codes that it understands so if it doesnt understand ex. IE wont understand -moz-opacity: so it will just skip it and ignore it but it will understand filter: alpha(opacity); and it will then run that code or whatever, I hope I helped in some way because usually different css files is not neccesary, css was created for exactly that purpose to eliminate cross browser problems.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users