knystrom18 Posted November 28, 2012 Share Posted November 28, 2012 So, stylesheets normally exist in the head element, the style tag, or in an inline attribute (style="margin:0;). What about this? <div style="stylefile.css"> I wrote a quick test page, and it validates to XHTML 1 Strict, but the stylesheet linked in the head element takes precedence, and I don't see any styling from the other. It seems like this should work because of the validation, but it doesn't (for me at least.) Is this slow browser implementation, or something else? Link to comment Share on other sites More sharing options...
Ingolme Posted November 28, 2012 Share Posted November 28, 2012 It's valid XHTML but that doesn't mean it's functional. Only CSS code can go in the style attribute. It's valid XHTML because the style attribute exists and it contains character data, but that doesn't mean that the CSS parser can make any sense of it. You need to use the <link> element to load external CSS files. Link to comment Share on other sites More sharing options...
knystrom18 Posted November 29, 2012 Author Share Posted November 29, 2012 Hmm.. Interesting. Thanks Inglome. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now