问题
Are there any other types that browsers support for the style tag besides "text/css"? (Excluding any synonyms for css). If not, then why not?
<style type="???"> ... </style>
回答1:
There also are XSL (Extensible Stylesheet Language) stylesheets for styling XML documents. They cannot be used with HTML though.
CSS works for XML docs, but using XSL is recommended. Opposed to CSS, XSL is a Transformation Language (transforms input text written in a formal language into a modified output text).
Further references:
http://www.w3.org/Style/
http://www.w3.org/Style/XSL/
回答2:
There were others. JSSS was implemented by Netscape 4.
There's a decent summary here - http://www.articlesbase.com/web-design-articles/other-styling-languages-in-the-market-available-or-not-4036049.html
Note that in browsers, and in HTML5, the type attribute is optional. If it is omitted, "text/css" is assumed.
回答3:
Style type defines how will the text between this tags read. This page states as follows [14.2.3]:
http://www.w3.org/TR/html4/present/styles.html
Attribute definitions type = content-type [CI] This attribute specifies the style sheet language of the element's contents and overrides the default style sheet language. The style sheet language is specified as a content type (e.g., "text/css"). Authors must supply a value for this attribute; there is no default value for this attribute.
So text/css is the only one if you want it to be CSS. For the other ones refer to:
http://www.w3.org/TR/html4/types.html#type-content-type
回答4:
It is the content type (MIME Type). There are other types, but not applicable to the style tag.
回答5:
It just specifies the MIME content type of the element. The only styling language used in websites is text/css.
If using the HTML5 doctype, you can simply use <style>#css{is:awesome}</style>.
回答6:
There are not. But there conceivably could be.
来源:https://stackoverflow.com/questions/6077905/style-type-text-css-what-else-is-there