HTML style type property
Examples
Using the type attribute in <style> tag:
<style type="text/css">
h1 {color:red;}
p {color:blue;}
</style>
h1 {color:red;}
p {color:blue;}
</style>
try it"
Browser Support
All major browsers support the type attribute.
Definition and Usage
The required type attribute specified MIME type of style sheet.
type attribute indicates the <style> tag and content between the </ style>.
Value "text / css" indicating that the content is standard CSS.
Differences between HTML 4.01 and HTML5
In HTML5, type attribute is no longer necessary. The default value is "text / css".
grammar
<style type="MIME_type">
Property Value
值 | 描述 |
---|---|
MIME_type | 样式表的 MIME 类型。目前,唯一可能的值是 "text/css"。 查看完整标准 MIME 类型列表 IANA MIME 类型 。 |
HTML <style> tag