<style> Tag Attributes

Attributes of the <style> tag
global attributes In addition to the personal attributes of the <style> tag below, any of the common HTML attributes can also be coded.
media

The value of the media attribute is a media type or a comma-separated list of media types indicating an "or" relationship. Some browsers may also recognize expressions with media queries, such as handheld and (min-width:200px).

Continuous media types

  • media="braille"
  • media="screen"
  • media="speech"
  • media="tty"

Hybrid (continuous or paged) media types

  • media="all" (default)
  • media="handheld"
  • media="tv"

Paged media types

  • media="embossed"
  • media="print"
  • media="projection"

These media query values can also be used in the media attribute of the <link/> tag and in the @media and @import CSS Rules.

scoped="scoped" Sets the value of the <style scoped> boolean attribute to true. Omitting it sets to false.
title Although title is one of the common HTML attributes, which can be coded on any HTML element, it is entirely different when coded on the style tag:
  • A title attribute on the style tag indicates that the style element defines an alternative style sheet.
  • The name of the alternative style sheet is the value of the title attribute.
  • The value of the title attribute is not inherited from its ancestors. A style element without a title defines a primary style sheet.
type

specifies a MIME media type and subtype, without a charset attribute

type="text/css" (default)
type="media-type/subtype"