HTML and CSS Reference
In-Depth Information
Project files update (ch11-01): If you haven't followed the previous instructions and are comfortable working from
here onward or would like to reference the project files up to this point, you can download them from .
Styling Text
The previously described properties manipulate the font face but properties of the text can also be changed, such as
color, decoration, alignment, and so on.
Initial value: browser dependent | Inherited: Yes | Applies to: All | CSS2.1
Browser support: IE 3+, Firefox 1+, Chrome 1+, Opera 3.5+, Safari 1+
The initial value for the color of text is browser dependent although all browsers in use today use black text, except
for links, which are blue when unvisited, purple when visited, and red when active.
1. In styles.css, below the .benefits rule set, add a new rule set:
.benefits ul {
color: #38AEDB;
2. Save styles.css.
The text under “Why Choose Cool Shoes & Socks?” is now blue, helping draw the users eye to it. Shortly you'll add
images to these points to make them stand out even more.
Color values such as keywords, hex values, and rgb() can be used to apply color to text, as explained in Chapter 3.
Initial value: none | Inherited: No | Applies to: All | CSS2.1
Browser support: IE 3+, Firefox 1+, Chrome 1+, Opera 3.5+, Safari 1+
The text-decoration property allows you to change the line decoration applied to text. You can use the values
underline , overline , and line-through . The CSS2.1 specification also describes the value blink , but
due to the accessibility concerns blinking text raises, the CSS3 Text module no longer lists this value and browsers
do not support it.
The CSS3 Text module ( ) shows that the text-decoration
property will eventually become a shorthand for the properties text-decoration-line , which takes the same
values as the current text-decoration ( underline , overline , and line-through ); text-
decoration-color , which lets you change the color of the line; and text-decoration-style , which lets
Search WWH ::

Custom Search