HTML style type attribute

Example

Use of the type attribute in a <style> tag:
<html>
<head>
<style type="text/css">
h1 {color:red}
p {color:blue}
</style>
</head>
<body>
<h1>Header 1</h1>
<p>A paragraph.</p>
</body>
</html>


Definition and Usage

The required type attribute specifies the MIME type of the style sheet.
The type attribute identifies the content between the <style> and </style> tags.
The value "text/css" indicates that the content is standard CSS.

Browser Support

The type attribute is supported in all major browsers.

Syntax

<style type="value">

Attribute Values

Value Description
mime_type The MIME type of the style sheet. For now, the only possible value is "text/css"
Share this article :
 
Copyright © 2012. Best Online Tutorials | Source codes | Programming Languages - All Rights Reserved