HTML and CSS Reference
In-Depth Information
14.4.4 Working with Text
If you want to make a business card, how do you put extra space between each of the
letters of your company name? If you're writing a science term paper, how do you deal
with exponents, equations, or subscripts? And how do you make it double-spaced? If
you're writing a cool poem and want your text in the shape of an hourglass or a circle
to give it visual appeal, or you just want to emphasize certain words to make your
point for a presentation, then what to do? The CSS controls listed in Table 14.8 could
be your answer.
Table 14.8 Text Alignment Properties
Property
Value/Example
ElementsAffected
letter-spacing
normal, 0.1em
All
line-height
normal, 1.2, 1.2em, 120%
All
text-align
left, right, center, justify
All
text-decoration
underline, overline, line-through, blink
All
text-indent
3em, 15%
Block-level
elements
text-transform
capitalize, uppercase, lowercase, none
All
vertical-align
baseline, sub, super, top, text-top, middle,
bottom, text-bottom, 50%
Inline elements
word-spacing
normal, 2em
All
EXAMPLE 14.5
<html>
<head><title>First Style Sheet</title>
<style type="text/css">
1
#title{
2
word-spacing: 10px;
letter-spacing: 4px;
text-decoration: underline;
text-align: center;
font-size: 22pt ;
font-family:arial;
font-weight: bold;
}
 
 
Search WWH ::




Custom Search