homepage Welcome to WebmasterWorld Guest from 54.211.230.186
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Cascade, @import, and validation
it clearly works, but...
dingman

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 475 posted 1:17 am on Dec 31, 2002 (gmt 0)

I've got a page with a <link>ed main stylesheet immediately followed by an @imported one. It works in the browsers just fine, but if I try to validate the page with the w3c CSS validator, the @import is completely ignored. I can check it separately, and the @imported sheet validates. I know my <style...> tag is fine, because if I comment out the <link...> the validator finds the @imported sheet for the page just fine. What gives?

Is the w3c interpreting "CSS2 user agents must ignore any '@import' rule that occurs inside a block or that doesn't precede all rule sets" in the standard [w3.org] to mean that at most one style-sheet can be imported, unless somehow the first one contains no rule sets? What about @media foo { rules for displaying on a foo; } @media bar { but bars are entirely different; }?

 

marek

10+ Year Member



 
Msg#: 475 posted 3:20 am on Dec 31, 2002 (gmt 0)

dingman: more stylesheets can be imported. For instance you can do something like that:

<style media="all" type="text/css">
@import "css1.css";
</style>
<style media="print" type="text/css">
@import "css2.css";
</style>

The validator should check all of them, including inline styles.

dingman

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 475 posted 4:58 am on Dec 31, 2002 (gmt 0)

It works in the browsers, no question. It's just that jigsaw.w3.org is ignoring any @imports after the <link>ed sheet for me, but sees them if I simply comment out the <link>.

I'm trying to put together a much simplified example, but having the reverse problem now - browsers don't care, but jigsaw.w3.org/css-validator sees all the CSS files.

dingman

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 475 posted 5:07 am on Dec 31, 2002 (gmt 0)

Nevermind. Either the problem has misteriously gone away or I was immagining it, because I can't reproduce it with the full site that orriginally made me think of it, either.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved