Menu
Document Structure & Metadata

<style> Tag

Embed CSS directly inside the HTML document.

1Inline Stylesheets

The <style> element lets you write CSS directly inside <head>. Useful for critical above-the-fold styles or single-file demos.

Example Code
<head>
  <style>
    body { font-family: system-ui; margin: 2rem; }
    h1 { color: #4f46e5; }
  </style>
</head>

Finished reading?

Mark this topic as complete to track progress.