Latest web development tutorials

HTML style type property

HTML style tags Reference Manual HTML <style> tag

Examples

Using the type attribute in <style> tag:

<style type="text/css">
h1 {color:red;}
p {color:blue;}
</style>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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 tags Reference Manual HTML <style> tag