XML technologies / HTML & XHTML / Alphabetical list of HTML and XHTML elements / style

(Excerpt from "HTML & XHTML ─ kurz & gut" by Jennifer Niederst Robbins)

A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

   

style

HTML 4.01 | HTML 5

<style> ... </style>

Marks style definitions, usually Cascading Style Sheets, in the head section of the document.

Notes

In HTML 5, the element style can also be used in the body section of the document.

Start/end tag

Required/required

Attributes

Internationalization, global HTML 5 attributes

  • id="Text"

    XHTML and XHTML 5. Assigns a name that uniquely identifies the element.

  • media="all|aural|braille|handheld|print|projection|screen|tty|tv"

    Specifies the output medium to which the style definitions apply. A single keyword or a comma-separated list can be specified. In HTML 4.01, the default is screen, and in HTML 5 all.

  • scoped (scoped="scoped" in XHTML 5)

    HTML 5 only. Applies the style definitions only to the local document tree, that is, descendants of the element containing the style element.

  • title="Text"

    Gives the embedded stylesheet a title.

  • type="Inhaltstyp" (text/css)

    Required in HTML 4.01. Defines the stylesheet language. For Cascading Style Sheets (CSS, currently the only supported stylesheet type), the value is text/css. In HTML 5, the attribute type is optional when CSS is used.

  • xml:space="preserve"

    XHTML only. Instructs XML processors to preserve whitespace within the element.

Example

<head>
<style type="text/css">
  h1 {color: #666;}
</style>
<title>Wissenschaftliche Präsentation</title>
</head>

 

> back to the alphabetical list of elements

   

 

 

 

back to top