Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a way to reference another CSS page when IE is used? 2

Status
Not open for further replies.
Looking at your page, it looks pretty simple. It should work ok with all the currently popular browsers: IE6, Mozilla, FF, NN7, Opera 7+, etc. The first thing to know is to put the correct DOCTYPE at the beginning of the document (you already have that). Next is to validate your (x)html and css at all times and finally use correct tags to display correct items on your page. I am afraid I cannot test your page across different browsers at the moment, but think that it should work ok if you follow the above guidelines. If you still need browser specific css, look at the options here:
There should be options how to do it without javascript, which is the best way to go.
 
The trick is to have a standard style sheet for all standard compliant browsers and then to have a second style sheet with just the exception style rules for IE.

You can do it like this:

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

The IF is only read by IE, other browsers think its a comment and thus ignore it.

good luck!
 
remco: this was a very valuable post!
I gave you a star for it, even though I dont need it. I however see that it is a valuable post.

Olav Alexander Mjelde
Admin & Webmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top