<style>

The style element embeds CSS rules directly within an HTML document.

Since HTML 4.0 Spec ↗

Syntax

<style>...</style>

Examples

<style>
  body { font-family: system-ui; }
  .accent { color: oklch(0.7 0.15 250); }
</style>
Output
Applies a system UI font to the page and an oklch accent color to .accent elements.

Notes

Usually placed in <head>. Inline critical CSS here to avoid render-blocking external requests; large stylesheets belong in external files via <link>. Subject to CSP style-src.

Browser & runtime support

EnvironmentSince version
chrome 1.0
firefox 1.0
safari 1.0
edge 12

See also