Jan
6
6
CSS Text Properties
Posted in CSS Tutorials by kdwhd
0
Css Text Properties
While CSS Font Properties covers most of the traditional ways to format your text, CSS Text Properties allows you to control the spacing, decoration, and alignment of your text.
The style sheet code:
1 2 3 |
.heading { text-align: center; text-transform: uppercase; color: #8493cb; }
.paragraph { text-indent: 12px; text-align: justify; line-height: 16px; }
a { text-decoration: none; color: #990000; }
|
The HTML code:
1 2 |
<h1 class="heading">sample paragraph</h1>
<p class="paragraph">This example includes several text formatting properties. The heading uses the text-align, text-transform, and color properties. The paragraph is indented, aligned, and extra space is added between the lines. Not only did we make this pretend link red, we also removed the default underline.</p>
|
The result:
sample paragraph
This example includes several text formatting properties. The heading uses the text-align, text-transform, and color properties. The paragraph is indented, aligned, and extra space is added between the lines. Not only did we make this pretend link red, we also removed the default underline.
This example demonstrates letter-spacing.
1 2 |
.lessspace { letter-spacing: -3px; }
.morespace { letter-spacing: 3px; }
|
Less Space
More Space
This example demonstrates word-spacing.
1 |
.wordspacing { word-spacing: 30px; }
|
More space between words.
This example demonstrates white-space.
1 2 3 |
.normalspace { white-space: normal; }
.prespace { white-space: pre; }
.nowrapspace { white-space: no-wrap; }
|
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text.
This is some text. This is some text. This is some text. This is some text. This is some text. This is some text.
CSS Text Properties
|









