jump

HTML 5: The Markup Language (ARIA Edition)

stylestyle (presentation) information # T

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

Permitted contents #

Permitted attributes #

global attributes
Any attributes permitted globally.
type = MIME type #
A valid MIME type that designates a styling language.
A string that identifies a valid MIME media type as defined in [RFC 2046].
media = media-query list #
Specifies which media the styles apply to.
A valid media query list as defined in [Media Queries].
scoped = d:string "scoped" or d:string "" 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 LinkStyle;

Typical default display properties #

style {
display: none; }