Skip to navigation

HTML Tag: style

Applies styles, typically CSS, at a page-level (as opposed to linking to an external CSS file). Typically placed inside the head element.

Optional Attributes

Attribute Description Possible values
media Which media the styles are associated to. Media query, such as screen, print, or screen and max-width:640.
type The type of the linked resource. MIME type. Typically text/css (default).
scoped Applies styles only to the style element’s parent element. When absent, the style element should appear in the head element. None.
Global attributes


<head lang="en">
        /* Here be CSS for UHVerything */
    <style media="print">
        /* Here be CSS applied exclusively when the page is printed */


<!-- blah -->

    <style scoped>
        /* Here be CSS applied exclusively to this element's parent */
    <p>So this element, and everything in its parent div, will get special treatment.</p>