HTML Style Element

The HTML style element is used to set relationships of other documents with this document. For example a style sheet that is used to control element style may be defined with this element. The HTML style element is placed inside the header and is used to embed a style sheet in the HTML document. HTML style element attributes include:

  • Type - Defines the content type such as "text/css".
  • Media - Defines the intended media the page will be displayed on. Possible values include all, aural, braille, handheld, print, projection, screen, tty, and tv. The default is screen.
  • Title - Gives the title sheet an optional title.

Example Embedded Style Sheet

When setting document style, place the STYLE element with the <style> beginning tag and </style> ending tag between the HEAD and the BODY elements. Therefore placement would be as follows:

<title>Example Style Settings</title>
<style type="text/css">
body {background: #FFFFFF; color: #000000; margin-top: 6%;
margin-left: 3%; margin-right: 3%}
h1 {font: 14pt ariel; color: #0000FF}
h2, h3, h4 {margin-left: -3%}
p {font: 12pt roman; text-indent: 0.5in}
a {color: #00FF00; text-decoration: none}