文本颜色:color
文本的对齐方式:text-align
文本修饰:
text-decoration:none 取消下划线
text-decoration:overline 添加上划线
text-decoration:line-through 添加中划线
text-decoration:underline 添加下划线
文本转换:
/*小写转大写*/
text-transform:uppercase
/*大写转小写*/
text-transform:lowercase
/*单词首字母大写*/
text-transform:capitalize
文本缩进:
text-indent:50px;

所有属性:
属性 描述
letter-spacing 设置字符间距
line-height 设置行高
direction 设置文本方向
text-shadow 设置文本阴影
text-transform 控制元素中的字母
unicode-bidi 设置或返回文本是否被重写
vertical-align 设置元素的垂直对齐
white-space 设置元素中空白的处理方式
word-spacing 设置字间距


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>文本格式</title>
<link rel="stylesheet" href="demo.css">
</head>
<body>
<h1>文本格式</h1>
<h2>This text is styled with some of the text formatting properties.
The heading uses the text-align, text-transform, and color properties.
The paragraph is indented, aligned, and the space between characters is specified.
The underline is removed from the "尝试一下" link.</h2>

<h1>CSS text-align 实例</h1>
<p class="date">2015 年 3 月 14 号</p>
<p class="main">“当我年轻的时候,我梦想改变这个世界;当我成熟以后,我发现我不能够改变这个世界,我将目光缩短了些,决定只改变我的国家;当我进入暮年以后,我发现我不能够改变我们的国家,我的最后愿望仅仅是改变一下我的家庭,但是,这也不可能。当我现在躺在床上,行将就木时,我突然意识到:如果一开始我仅仅去改变我自己,然后,我可能改变我的家庭;在家人的帮助和鼓励下,我可能为国家做一些事情;然后,谁知道呢?我甚至可能改变这个世界。”</p>
<p><b>注意:</b> 重置浏览器窗口大小查看 "justify" 是如何工作的。</p>

<h1>文本修饰</h1>
<a href="http://www.baidu.com">百度一下</a>
<h1>李白</h1>
<h2>杜甫</h2>
<h3>孟浩然</h3>
<h1>文本转换</h1>
<p class="uppercase">This is some text.</p>
<p class="lowercase">This is some text.</p>
<p class="capitalize">This is some text.</p>
</body>
</html>
/*h1 {*/
/*color: #FFA500;*/
/*!*文本的对齐方式*!*/
/*text-align: center;*/
/*}*/

/*h2 {*/
/*color: rgb(255, 0, 0);*/
/*}*/

p.date {
/*文本的对齐方式*/
text-align: right;
}

p.main {
/*文本的对齐方式*/
text-align: justify;
}

a {
text-decoration: none; /*取消下划线*/
}

/*添加上划线*/
h1 {
text-decoration: overline;
}

/*添加中划线*/
h2 {
text-decoration: line-through;
}

/*添加下划线*/
h3 {
text-decoration: underline;
}

/*小写转大写*/
p.uppercase {
text-transform: uppercase;
}

/*大写转小写*/
p.lowercase {
text-transform: lowercase;
}

/*单词首字母大写*/
p.capitalize {
text-transform: capitalize;
}

/*文本缩进*/
p {
text-indent: 50px;
}