Is there any style besides text / css?

Possible duplicate:
style type = "ext / css" ... what else is there?

I see that when defining a css section it always

<style type="text/css"> </style> 

Is there anything else? Just curious.

+2
source share
5 answers

HTML 4 and 5 make it possible to open other types, but do not specify any words "text / css". In practice, I have never encountered a case where anything other than "text / css" is used. For this reason, the HTML5 specification made the type attribute optional. If omitted, the default type is text / css. See the style tag specification for more details:

The type attribute gives the style language. If an attribute is present, its value must be a valid MIME type that denotes a language style. The charset parameter is not specified. The default value is for the type attribute, which is used if the attribute is missing "text / css". RFC2318

HTML 4 documents must have the type attribute specified. The specification does not limit the values ​​that can be used:

This attribute defines the language of the stylesheet for the content item and overrides the default language of the stylesheet. The sheet language style is indicated as the type of content (for example, "text / css"). Authors must provide a value for this attribute; There is no default value for this attribute.

In older versions of HTML (<= 4), the type attribute is an attempt to maintain compatibility with the <link> method of importing style sheets where type is required:

 <link rel="stylesheet" href="style.css" type="text/css" /> 
+6
source

There seems to be no default for this

http://www.w3.org/TR/html4/present/styles.html#adef-type-STYLE

Authors must provide a value for this attribute; There is no default value for this attribute.

There are many options, although text/css seems to be the only reasonable style.

http://www.w3.org/TR/html4/types.html#type-content-type

+1
source

Any value will be legal HTML4.01, but the user agent will need to support it. This is the same as specifying the script language - technically you could have something, in fact only ecmascript / javascript has wide support.

+1
source

From what I know, "text / css" is the only type of style you can have.

A source

Another source

0
source

Source: https://habr.com/ru/post/1490541/


All Articles