
Educators: Earn a free Gold upgrade by joining the PBwiki Back To School Challenge.
Colors in CSS
Colors are used in a wide variety of ways in CSS. Colors can be applied to text, borders, backgrounds, links, bullets, and many other web items.
Colors in CSS are represented by a # followed by a 6 digit code. This code, known as the Hexidecimal system is base 16 and goes from 00-FF. All colors are represented in this way with the excpetions of the basic colors which can be applied by using their name (i.e. "white") or their hexidecimal code.
Example:
Black: #000000
Blue: #0000FF
As a side note, their are 216 web safe colors. While this is an old term (it was created to describe all the colors that would display on a monitor) and is now opsolete (due to new monitor technology), it is still important since someone viewing your website may be using an old monitor.
CSS Color Examples:
External CSS
body {background-color:#000000; color:#FFFFFF; }
Sets the background color of a webpage to black and the text to white.
Internal CSS
<p style="color:red">This is Red</p>
Makes the text in the <p> red.
Page Information
|
Wiki Information |
Recent PBwiki Blog Posts |