HTML: The Markup Language

stylestyle (presentation) information # T

The style element allows style information to be embedded in documents.

Permitted content #

Permitted attributes #

Descriptions for attributes specific to this element #

type = MIME type
A valid MIME type that designates a styling language.
media = media-query list
Specifies which media the styles apply to.
scoped = "scoped" or "" (empty string) or empty NEW
Indicates that the specified style information is meant to apply only to the style element’s parent element, and that element’s child nodes. Otherwise, the specified styles are meant to apply to the entire document.

Additional constraints and admonitions #

Tag omission #

A style element must have both a start tag and an end tag.

Permitted parent elements #

any element that can contain metadata elements, div, noscript, section, article, aside

DOM interface #

interface HTMLStyleElement : HTMLElement {
           attribute boolean disabled;
           attribute DOMString media;
           attribute DOMString type;
           attribute boolean scoped;
HTMLStyleElement implements ;

Typical default display properties #

style {
display: none; }