|
| |
|
|
hzarabet
Posts: 1540 From: New Milford CT USA Status: offline
|
@import question - 4/29/2004 23:16:28
Hi all... Here is my @import tag <link href="css/site_nn.css" type="text/css" rel="stylesheet" /> <style type="text/css">@import url(css/site.css);</style> WHY OH WHY are changes I am making to css/site_nn.css, which should ONLY affect NS4, affecting my page when viewed on IE6????? I am relearning the meaning of learning curve!
_____________________________
http://www.SigningsHotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada
|
|
|
|
Giomanach
Posts: 6112 Joined: 11/19/2003 From: England Status: offline
|
RE: @import question - 4/30/2004 0:25:38
IE will be reading both Stylesheets, you need to use JavaScript to tell the browser which on to use
_____________________________
|
|
|
|
d a v e
Posts: 4136 Joined: 7/24/2002 From: England (but live in Finland now) Status: offline
|
RE: @import question - 4/30/2004 1:23:00
that's the idea that it reads both stylesheets. no javascript required (see http://www.mako4css.com/csstwo.htm ) NN4 sees only the first sheet, IE and NN6+ merge both and give more importance to the second sheet due to the importance of the cascade. so if you don't make a declaration in *both* sheets then IE will pick up any unmatched styles from the first. e.g. NN4 sheet: .warning {color:red} IE sheet .warning {color:yellow} so NN4 can *only* see the first rule and warning text will be red. IE takes the first rule *then* overwrites it with the more important rule that follows (why is it more important? because of the cascade) and it is yellow in IE so if you have a style that *only* appears in the NN4 sheet then IE will see it as well and use only that because it doesn't have a version in its own sheet. it's ok to put unique style rules in the IE sheet but not in the NN4 one you need the same name (e.g. .warning) even though the details are different
_____________________________
David Prescott Gekko web design
|
|
|
|
hzarabet
Posts: 1540 From: New Milford CT USA Status: offline
|
RE: @import question - 4/30/2004 9:13:53
Thanks Dave! Very Good explanation. I though is was "A" OR "B"!
_____________________________
http://www.SigningsHotline.com lists EVERY upcoming athlete autograph appearance in the US and Canada
|
|
|
|
d a v e
Posts: 4136 Joined: 7/24/2002 From: England (but live in Finland now) Status: offline
|
RE: @import question - 5/1/2004 10:46:57
i *think* that @import is useful if you want to add supplementary stylesheets e.g you have a main coprorate stylesheet business.css, then for a practicular department you might want it to follow all the main rules for layout and font choice but you want it on a different colour background and the links to be green - then you can import a second sheet to append the styles in the main one, either adding to or modifying existing styles, and the second sheet has a higher specifity for any given rule of the same potential weight weight because of the cascade. I don't know but i don't think you can do this with linked styles, but i'm not sure at all. maybe Mháircaish can clarify?
_____________________________
David Prescott Gekko web design
|
|
|
|
d a v e
Posts: 4136 Joined: 7/24/2002 From: England (but live in Finland now) Status: offline
|
RE: @import question - 5/1/2004 10:50:12
i *think* that @import is useful if you want to add supplementary stylesheets e.g you have a main coprorate stylesheet business.css, then for a practicular department you might want it to follow all the main rules for layout and font choice but you want it on a different colour background and the links to be green - then you can import a second sheet to append the styles in the main one, either adding to or modifying existing styles, and the second sheet has a higher specifity for any given rule of the same potential weight weight because of the cascade. I don't know but i don't think you can do this with linked styles, but i'm not sure at all. maybe Mháircaish can clarify?
_____________________________
David Prescott Gekko web design
|
|
|
|
d a v e
Posts: 4136 Joined: 7/24/2002 From: England (but live in Finland now) Status: offline
|
RE: @import question - 5/1/2004 13:11:13
no you don't need to. i usually just use the link method anyway.
_____________________________
David Prescott Gekko web design
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|