W3c html text color

CSS color Property

Tip: Use a background color combined with a text color that makes the text easy to read.

Default value: not specified
Inherited: yes
Animatable: yes. Read about animatable Try it
Version: CSS1
JavaScript syntax: object.style.color=»#0000FF» Try it

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

CSS Syntax

Property Values

Value Description Demo
color Specifies the text color. Look at CSS Color Values for a complete list of possible color values. Demo ❯
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

More Examples

Example

Set the text color with a HEX value:

Example

Set the text color with an RGB value:

Example

Set the text color with an RGBA value:

Example

Set the text color with a HSL value:

Example

Set the text color with a HSLA value:

Читайте также:  Сборник задач на php

Unlock Full Access 50% off

COLOR PICKER

colorpicker

Join our Bootcamp!

Report Error

If you want to report an error, or if you want to make a suggestion, do not hesitate to send us an e-mail:

Thank You For Helping Us!

Your message has been sent to W3Schools.

Top Tutorials
Top References
Top Examples
Get Certified

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Источник

W3.CSS Colors

The default color scheme used in W3.CSS is inspired by Material Design Colors (colors used in marketing, road signs, and sticky notes).

Coloring HTML Elements

The w3-color and w3-text-color classes can be used to color any HTML element:

Containers:

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Buttons:

Text:

Borders:

Tables:

Cards:

A car is a wheeled, self-powered motor vehicle used for transportation. Most definitions of the term specify that cars are designed to run primarily on roads, to have seating for one to eight people, to typically have four wheels. (Wikipedia)

Background Colors

The w3-color classes set the background color for any HTML element:

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Example

London

London is the most populous city in the United Kingdom,
with a metropolitan area of over 9 million inhabitants.

London

London is the most populous city in the United Kingdom,
with a metropolitan area of over 9 million inhabitants.

London

London is the most populous city in the United Kingdom,
with a metropolitan area of over 9 million inhabitants.

The colors gray and grey are interchangeable in all W3.CSS classes.

Text Colors

The w3-text-color classes set the text color of any HTML element:

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Example

London

London is the most populous city in the United Kingdom,
with a metropolitan area of over 9 million inhabitants.

Hover Colors

The w3-hover-color classes define the background hover color for any HTML element:

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Example

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

The w3-hover-text-color classes define the text hover color for any HTML element:

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Example

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Color libraries

In addition to standard W3.CSS colors, W3.CSS can also use colors from a lot of different color libraries:

Источник

Color keywords

Note: As of [CSS Color], the CSS2 System Color values have been deprecated in favor of the CSS3 UI ‘[appearance]’ property.

  • ActiveBorder
    Active window border.
  • ActiveCaption
    Active window caption.
  • AppWorkspace
    Background color of multiple document interface.
  • Background
    Desktop background.
  • ButtonFace
    The face background color for 3-D elements that appear 3-D due to one layer of surrounding border.
  • ButtonHighlight
    The color of the border facing the light source for 3-D elements that appear 3-D due to one layer of surrounding border.
  • ButtonShadow
    The color of the border away from the light source for 3-D elements that appear 3-D due to one layer of surrounding border.
  • ButtonText
    Text on push buttons.
  • CaptionText
    Text in caption, size box, and scrollbar arrow box.
  • GrayText
    Grayed (disabled) text. This color is set to #000 if the current display driver does not support a solid gray color.
  • Highlight
    Item(s) selected in a control.
  • HighlightText
    Text of item(s) selected in a control.
  • InactiveBorder
    Inactive window border.
  • InactiveCaption
    Inactive window caption.
  • InactiveCaptionText
    Color of text in an inactive caption.
  • InfoBackground
    Background color for tooltip controls.
  • InfoText
    Text color for tooltip controls.
  • Menu
    Menu background.
  • MenuText
    Text in menus.
  • Scrollbar
    Scroll bar gray area.
  • ThreeDDarkShadow
    The color of the darker (generally outer) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.
  • ThreeDFace
    The face background color for 3-D elements that appear 3-D due to two concentric layers of surrounding border.
  • ThreeDHighlight
    The color of the lighter (generally outer) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.
  • ThreeDLightShadow
    The color of the darker (generally inner) of the two borders facing the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.
  • ThreeDShadow
    The color of the lighter (generally inner) of the two borders away from the light source for 3-D elements that appear 3-D due to two concentric layers of surrounding border.
  • Window
    Window background.
  • WindowFrame
    Window frame.
  • WindowText
    Text in windows.

Источник

W3.CSS Colors

The default color scheme used in W3.CSS is inspired by Material Design Colors (colors used in marketing, road signs, and sticky notes).

Coloring HTML Elements

The w3-color and w3-text-color classes can be used to color any HTML element:

Containers:

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Buttons:

Text:

Borders:

Tables:

Cards:

A car is a wheeled, self-powered motor vehicle used for transportation. Most definitions of the term specify that cars are designed to run primarily on roads, to have seating for one to eight people, to typically have four wheels. (Wikipedia)

Background Colors

The w3-color classes set the background color for any HTML element:

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Example

London

London is the most populous city in the United Kingdom,
with a metropolitan area of over 9 million inhabitants.

London

London is the most populous city in the United Kingdom,
with a metropolitan area of over 9 million inhabitants.

London

London is the most populous city in the United Kingdom,
with a metropolitan area of over 9 million inhabitants.

The colors gray and grey are interchangeable in all W3.CSS classes.

Text Colors

The w3-text-color classes set the text color of any HTML element:

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Example

London

London is the most populous city in the United Kingdom,
with a metropolitan area of over 9 million inhabitants.

Hover Colors

The w3-hover-color classes define the background hover color for any HTML element:

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Example

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

The w3-hover-text-color classes define the text hover color for any HTML element:

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Example

London

London is the most populous city in the United Kingdom, with a metropolitan area of over 9 million inhabitants.

Color libraries

In addition to standard W3.CSS colors, W3.CSS can also use colors from a lot of different color libraries:

Источник

Оцените статью