CSS Setting Foreground Color of an Element
Description
Use the color command to set the foreground color of an element. Typically used to change text color.
Note: Any borders will assume the color unless explicitly set to a different color using border-color.
Note: This command will have no effect on images.
color: #rrggbb;
OR
color: rgb(0-255,0-255,0-255);
OR
color: #rgb;
OR
color: name;
Examples for Color
test text test text test text test text
<style>
#test { color: red; }
</style>
<div id="test">test text test text test text test text</div>
test text test text test text test text
<style>
#test2 { color: #ff0000; }
</style>
<div id="test2">test text test text test text test text</div>
test text test text test text test text
<style>
#test3 { color: #f00; }
</style>
<div id="test3">test text test text test text test text</div>
test text test text test text test text
<style>
#test4 { color: rgb(255,0,0); }
</style>
<div id="test4">test text test text test text test text</div>
test text test text test text test text
<style>
#test5 {
color: rgb(255,0,0);
border-style: solid;
border-width: 1px;
}
</style>
<div id="test5">test text test text test text test text</div>
Values for <Color>
| color |
color: #rrggbb; color: rgb(0-255,0-255,0-255); color: #rgb; color: name; |
Specifies the color of an element. Has no effect on images. Border will assume the same color unless explicitly set using border-color |