PDA

View Full Version : Using @import in stylesheets


Grant Palin
04-02-2003, 05:14 PM
I finally got around to using the @import rule in my main stylesheet to seperate out the stuff that will not work in Navigator 4. Really, it was just the static background watermark, which had worked fine in Internet Explorer 6 without a problem. But when I added the @import in the first stylesheet, and removed the watermark stuff and put it in the second stylesheet, it didn't work in IE at all. This is the first time I've tried using @import, so maybe I've done something wrong.:confused:

Anyway, here's the source for the two stylesheets. Please take a look and point out anything that's not right!

styles.css
@import url(IEStyles.css)

h1,h2,h3 {
color: #FFDE42;
}

p {
color: #999999;
text-indent: 25px;
}

li {
color:#ffffff;
}

body {
color : #ffffff;
background-color : black;
}

html {
scrollbar-face-color:gray;
scrollbar-arrow-color:#FFFFFF;
scrollbar-track-color:#C0C0C0;
scrollbar-shadow-color:gray;
scrollbar-highlight-color:white;
scrollbar-3dlight-color:gray;
scrollbar-darkshadow-Color:black;
}

html, body {
margin: 0;
}

IEStyles.css
body {
background : url(bkg_heroesgold.jpg);
background-attachment : fixed;
background-position : center;
background-repeat : no-repeat;
}

Catman
04-02-2003, 06:22 PM
Are you using the @import in an external style sheet? I'm not sure that will work -- my info says it needs to be inside a <style> element (and hence inside an html file rather than a css file).

meow
04-02-2003, 07:02 PM
No, it works that way too. :)

Grant Palin
04-03-2003, 02:18 AM
@import url(IEStyles.css);

I was missing the semicolon before. Not anymore...the darned thing works now. Geez, the smallest things...

meow
04-03-2003, 02:25 AM
*chuckles* :D I always do that too! I didn't see it was missing in your code either.