Advertisement
Home Open Editor ❯

HTML <style> type Attribute

Deprecated: Not Supported in HTML5.

Example

<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body {
  background: tomato;
}
h1 {
  color: white;
}
p {
  font-family: monospace;
}
</style>
</head>
<body>

<h1>The style element</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>

</body>
</html>

Try this code ❯

Meaning

The type attribute is used to define the type of style sheet. The value of the attribute should be the MIME type of the style sheet language used.

The most common current value for this attribute is text/css, which indicates a CSS format.


Standard Syntax

<style type="mediaType">...</style>


Advertisement

Attribute Values

Value Description
mediaType The Internet media type of the style sheet. For now, the only supported value is "text/css".
Home Open Editor ❯
Advertisement