Skip to main content

html-tags.com

<style>

Embeds CSS directly in the document head.

Baseline: Widely available · Document structure

When to use it

For small critical CSS inlined for performance, or single-file self-contained documents.

When not to

For anything beyond trivial size, an external stylesheet caches independently of the HTML; and never use style as a substitute for semantic element choice.

Key attributes

media
conditional media query

Example

<style>
  body { max-inline-size: 65ch; margin-inline: auto; }
</style>
Source — this snippet needs a fuller context to render.

Authoritative references