By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

HTML Style Tag

Reference on the HTML Style Tag. Including its useful example, and a list of the allowed attributes.

Edited: 2014-12-28 05:48

The Style Element is used to embed, or load external styling rules, such as CSS StyleSheet. These rules are used to control the appearance and layout of a page.

Attributes

Attribute:Value:Description:
AttrsOther AttributesI18n
typeContent TypeThe Content Type of the scripting language used.
mediaMedia DescriptorEither a single, or comma-separated list. I.e. "screen,print"
titleTextAdvisory title

Example

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">

  <head>
    <title>My first Website</title>
    <style type="text/css">
      h1 {color:#0000FF;}
      p {font-size:2em;}
    </style>
  </head>

  <body>
    <h1>My first use of Style</h1>
    <p>Using CSS to change the style of headings and paragraphs</p>

  </body>

</html>