| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
|
|
#2 (permalink) |
|
now with added beard
Join Date: Mar 2004
Location: Liverpool
Posts: 8,040
|
"conditional comments" is what you want ... code a 'normal' sheet for ie7/firefox/safari etc ... and test accordingly ... then create another css file - just containing the specific changes needed in order to fix those ie6 errors ... code like this in the head of yer document: <link href="/css/your_proper_stylesheet_here.css" rel="stylesheet" type="text/css"/> <!--[if lt IE 7]> <link rel="stylesheet" href="/css/your_ie6_version_here.css" type="text/css" /> <![endif]--> this bit : <!--[if lt IE 7]> will just force any ie browser (lighter than ie7) into reading yer other one ... and ... two fat ladies (bingo) ![]() |
|
|
|
#3 (permalink) |
|
competitionmaster 2.0
Join Date: Oct 2006
Location: USA
Posts: 1,508
|
<link rel="stylesheet" href="forfirefoxandie7.css" type="text/css" /> <!--[if IE 6]> <link rel="stylesheet" href="forie6.css" type="text/css" /> <![endif]--> I think its supposed to be IE6 if you want the other one to stay for ie7 |
|
|
|
#4 (permalink) |
|
Semantics, yay.
Join Date: Nov 2005
Location: Beverly, Massachusetts
Posts: 1,534
|
HTML Code:
The thought is that all browsers read from the first (main) style sheet, then IE6 goes through the second one and applies any styles inside of it, which are expected to be tweaks that differ from the first style sheet. |
|
|
|
#5 (permalink) |
|
competitionmaster 2.0
Join Date: Oct 2006
Location: USA
Posts: 1,508
|
More info here: CSS - Conditional comments |
|
|
|
#6 (permalink) |
|
Senior Member
Join Date: Jul 2007
Posts: 182
|
thank you all for your help, this is exactly what I needed. I have seen this in use before but I couldn't find it again. This wil hopefully help me and eliminate the need for all of the div tags I have needed for multiple cross platform browser support. |
|
|
|
#7 (permalink) |
|
Senior Member
Join Date: Jan 2005
Posts: 12,336
|
I wrote a thing on this very subject. This is how I use conditional comments and @import to decide which browsers I will and will not support. Using CSS to Target Multiple Internet Explorer Versions |
|
|
|
#8 (permalink) |
|
My Brand New Computer!
Join Date: Mar 2007
Location: London
Posts: 245
|
So is it right that you only have to put the code differences in the conditional style sheet, the first stylesheet will be read by all browsers including the one you are concerned with, then the conditional stylesheet is read again by the offending browser and differences are ammended? |
|
|
|
#10 (permalink) |
|
Semantics, yay.
Join Date: Nov 2005
Location: Beverly, Massachusetts
Posts: 1,534
|
Since we're on the topic, I wrote up a quick tutorial on how to target Safari. I'll mention that it uses JavaScript, and that's generally lame, but it's for those rare cases when the client is extremely picky, and you need the money: CSS Filtering for Safari : Marc Amos |
|
|
|
#14 (permalink) | |
|
trouble free and loverlee
Join Date: Mar 2003
Location: YooKay
Posts: 3,083
|
Quote:
CSS hacks series ? |
|
|
|
|
#15 (permalink) | |
|
Semantics, yay.
Join Date: Nov 2005
Location: Beverly, Massachusetts
Posts: 1,534
|
Quote:
|
|
|
|
|
#16 (permalink) | |
|
trouble free and loverlee
Join Date: Mar 2003
Location: YooKay
Posts: 3,083
|
Quote:
But then, I've never been a fan of using one technology to patch the holes in another. Of course, if you're delivering an override stylesheet to all versions of Safari using js, as you do in your technique, you're equally at the mercy of Safari fixing or altering the particular css rendering which led you to implement the targeted stylesheet in the first place. Horses for courses, I guess. |
|
|
|
|
#17 (permalink) | |
|
Semantics, yay.
Join Date: Nov 2005
Location: Beverly, Massachusetts
Posts: 1,534
|
Quote:
|
|
|
![]() |
|