color: ***;
Browser |
|
---|
The color property specifies the text (and border) color.
body {
color: red;
}
Property | Value | Explanation |
---|---|---|
color | color code or name | the color of the text |
Example
<html>
<head>
<title>TAG index</title>
<style type="text/css">
#example1 { color: red; }
#example2 { color: #0000ff; }
</style>
</head>
<body>
<p id="example1">The red text</p>
<p id="example2">The blue text</p>
</body>
</html>
- Output
-
The red text
The blue text
<html>
<head>
<title>TAG index</title>
<style type="text/css">
#example3 {
text-decoration: underline;
color: green;
}
#example4 {
border-bottom: 1px solid;
color: green;
}
</style>
</head>
<body>
<p id="example3">The green text</p>
<p><span id="example4">The green text</span></p>
</body>
</html>
- Output
-
The green text
The green text