The type attribute on a <style> tag specifies the media type of the style content.
A media type specifies the type and nature of the content.
On a <style> tag, the default is ‘text/css‘.
A type attribute on a <style> element. The attribute specifies the media type (formerly MIME type) of the CSS rules.
We will send you a confirmation email shortly.
<style type="text/css">
.success { color: teal; }
</style>
<h4 class="success">Your order has been approved!</h3>
<p>We will send you a confirmation email shortly.</p>
The type attribute specifies the media type of the style's content.
The default for a <style> element is 'text/css'.
Tip: For a <style> the default is 'text/css'. Since CSS is the only styling language, you can omit the type specification.
<style type="media-type">
Value | Description |
---|---|
media-type | The media type of the style rules. The default is 'text/css'. |
Here is when type support started for each browser:
Chrome
|
1.0 | Sep 2008 |
Firefox
|
1.0 | Sep 2002 |
IE/Edge
|
1.0 | Aug 1995 |
Opera
|
1.0 | Jan 2006 |
Safari
|
1.0 | Jan 2003 |
Back to <style>