style type=“text/css” … what else is there?

女生的网名这么多〃 提交于 2019-12-18 05:43:15

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!