HTML <style> tag

Usage

Defines a stylesheet for an individual web page. Should be placed within the <head> tag of the document.

Example

Code:

<head>
<style type="text/css">
p { color: blue }
h1 { font-size: 1.5em }
</style>
</head>

Required Attributes

  • type - used to specify the style type, usually "text/css"

Optional Attributes

  • media - defines what media the style should be used for - screen, tty, tv, projection, handheld, print, braille, aural, all
  • title - used to define a title for the style

Core Attributes