2011-11-29 19:07, Elli Vizcaino wrote:
Just started building out a new site I'm working on and
> I just figured out why there were only 2 browsers picking up > the CSS, Safari & Chrome, while the rest didn't and yet
both my CSS and document validated. I had text/javascript
> under the type attribute of my link tags.
If a browser interprets the content as CSS, then that's a bug. The purpose of the type attribute in <link rel=stylesheet ...> is to specify the stylesheet language. It is in practice defaulted to CSS, and CSS is for most purposes the only stylesheet language that can be used for HTML documents. But if you do specify the attribute, then the browser is required to interpret the content according to it. And since JavaScript is not a stylesheet language, the contents should be ignored.
In practice it is best to omit the type attribute, since it serves no useful purpose but can cause harm if misspelled.
Markup validators in the old (SGML) sense of the word only verify compliance to a formalized syntax. For the type attribute, this basically means "anything goes". In HTML5 validation, the attribute value is checked to be a correctly formed Internet media type, such as foo/bar, but it does not even check that the type is a registered one, still less that denotes (for example) a stylesheet.
Yucca ______________________________________________________________________ css-discuss [[email protected]] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ List policies -- http://css-discuss.org/policies.html Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
