Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does the <style> tag in HTML take a type attribute?

Tags:

html

I mean does anyone use a value different than "text/css"?

like image 348
Emanuil Rusev Avatar asked Jun 22 '10 12:06

Emanuil Rusev


People also ask

What is type attribute in style tag?

The type attribute specifies the Internet media type (formerly known as MIME type) of the <style> tag. The type attribute identifies the content between the <style> and </style> tags. The default value is "text/css", which indicates that the content is CSS.

Does style tag need type?

The “type” attribute for the “style” element is not needed and should be omitted. The HTML <style> element contains style information for a document, or part of a document, defined in CSS. This element does not need the type attribute anymore, so it should be omitted.

Why style attribute is used in HTML?

The style attribute specifies an inline style for an element. The style attribute will override any style set globally, e.g. styles specified in the <style> tag or in an external style sheet.

What is style type HTML?

Styles in HTML are basically rules that describe how a document will be presented in a browser. Style information can be either attached as a separate document or embedded in the HTML document.


2 Answers

CSS and JavaScript might have killed all their rivals and dominated the browser, but other languages have existed, and the victory of CSS/JS was much less certain when HTML 4 was being written.

For stylesheets, the only real contender was JSSS, which saw support in Netscape 4 (which had really poor CSS support due to it being an emulation layer over its JSSS engine).

like image 193
Quentin Avatar answered Oct 15 '22 01:10

Quentin


There is text/xsl. It is also good design to make it possible to add new alternative style types in the future.

like image 43
Sjoerd Avatar answered Oct 15 '22 02:10

Sjoerd