HTML <style> Tag

Description:

The HTML <style> tag is used for declaring style sheets within the head of your HTML document.

 

Specific Attributes:

Attribute Definition
name Defines the name of the parameter.
type Specifies the style sheet language as a content-type (MIME type).
media Specifies the device the document will be displayed on. Possible values:
  • all
  • braille
  • print
  • projection
  • screen
  • speech

Other Attributes:

Attribute Definition
dir

Specifies the text direction for the content in an element.
Possible Values:

  • rtl  (Right to Left)
  • ltr  (Left to Right)
lang Specifies a language code for the content in an element.
title Specifies a title to associate with the element. Many browsers will display this when the cursor hovers over the element (similar to a "tool tip").

Example Code:

<html>
<head>
<style type="text/css">
h1 { color:#800000 }
</style>
</head>

<body>
<h1>The &lt;style&gt; tag in action</h1>
</body>

</html>

Result