|
Learning to control and apply color in Web pages is easy and fun. Remembering all the different methods for adding color can become confusing, however. The following chart lists the different ways you can use Cascading Style Sheets to apply color to the different elements on your pages:
To Do This | Use This |
---|---|
Control background color (CSS) | selector {background-color: value} |
Control foreground (font) color (CSS) | selector {color: value} |
Specify colors by hex code (HTML or CSS) | #ffffff |
Specify colors by rgb percentages (CSS only) | rgb(#%,#%,#%) |
Specify colors by rgb numeric values (CSS only) | rgb(#,#,#) |
Create a special class selector (CSS) | selector.className |
Apply a class to an element | <element > |
|