HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
CSS has a lot of properties for formatting text
The color
property is used to set the color of the text.
The color is specified by:
Look at CSS Color Values for a complete list of possible color values.
The default text color for a page is defined in the body selector.
body {
color: blue;
}
h1 {
color: green;
}
In this example, we define both the background-color
property and the color
property:
body {
background-color: lightgrey;
color: blue;
}
h1 {
background-color: black;
color: white;
}
div {
background-color: blue;
color: white;
}
Important: High contrast is very important for people with vision problems. So, always ensure that the contrast between the text color and the background color (or background image) is good!
Property | Description |
---|---|
color | Specifies the color of text |