A <meta name="theme-color">
element has the following additional attributes:
content
A <meta>
element with name=theme-color
must have a content
attribute that defines the theme color. The value of content
attribute is as follows:
<color>
value
A valid color value, such as hexadecimal, RGB, named color, etc.
media
Optional
Any valid media type or query. If provided, the options for the document's theme color defined in the content
attribute are suggested to the browser when the media query matches.
Consider the following code that uses <meta>
to set a theme color:
<meta name="theme-color" content="#4285f4" />
The following image shows the effect of this setting in Chrome on an Android mobile device:
Image credit: from Icons & Browser Colors, created and shared by Google and used according to terms described in the Creative Commons 4.0 Attribution License.
Using a media query withtheme-color
You can provide a media type or query inside the media
attribute. The theme-color
will then only be set if the media condition is true. For example:
<meta
name="theme-color"
content="cornflowerblue"
media="(prefers-color-scheme: light)" />
<meta
name="theme-color"
content="dimgray"
media="(prefers-color-scheme: dark)" />
Specifications Browser compatibility
Loadingâ¦
See also<meta>
name
attribute color-scheme
valuecolor-scheme
CSS propertyprefers-color-scheme
media queryRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.5