Metadata Names

HTML meta name="color-scheme"

Declares supported document color schemes in preference order. Place early in the head to help browser-native UI choose an appropriate scheme; still provide CSS and test contrast. Place this metadata in the document head. Its consumer depends on the name: some values are browser settings, others are crawler or application metadata.

Formal Syntax & Structure

html syntaxhtml
<meta name="color-scheme" content="light dark">

Parameters & Attributes

NameTypeDescription
namekeywordUse color-scheme.
contentname-specific text or tokensExample value: light dark. Interpret according to the metadata name.

Working Example

Example Snippethtml
<!doctype html><html lang="en">  <head>    <meta charset="utf-8">    <title>Example</title>    <meta name="color-scheme" content="light dark">  </head>  <body>    <p>Example document</p>  </body></html>
HTML Reference