css教程:CSS文字属性的应用
TheCSStextpropertiesdefinetheappearanceoftext. CSS文字属性可用来定义文字的外观 设置文字的颜色Setthecolorofthetext Thisexampledemonstrateshowtosetthecolorofthetext. Examples实例: Source Code to Run [www.fun52.com] h1
The CSS text properties define the appearance of text.
CSS文字属性可用来定义文字的外观
设置文字的颜色 Set the color of the text
This example demonstrates how to set the color of the text.
Examples 实例:
Source Code to Run [www.fun52.com]
h1 {color: #00ff00}
h2 {color: #dda0dd}
p {color: rgb(0,0,255)}
标题一
标题二fun52.com
段落
[ 可先修改部分代码 再运行查看效果 ]
设置文字背景色 Set the background-color of the text
This example demonstrates how to set the background-color of a part of the text.
Examples 实例:
Source Code to Run [www.fun52.com]
span.highlight
{
background-color:yellow
}
This is a text. This is a text. This is a text. fun52.com This is a text. This is a text. This is a text. This is a text. This is a text. This is a text. This is a text.
[ 可先修改部分代码 再运行查看效果 ]
指定相邻字符的间隙 Specify the space between characters
This example demonstrates how to increase or decrease the space between characters.
Examples 实例:
Source Code to Run [www.fun52.com]
h1 {letter-spacing: -3px}
h4 {letter-spacing: 0.5cm}
This is header 1
This is header 4
www.fun52.com
[ 可先修改部分代码 再运行查看效果 ]
对齐文字 Align the text
This example demonstrates how to align the text.
Examples 实例:
Source Code to Run [www.fun52.com]
h1 {text-align: center}
h2 {text-align: left}
h3 {text-align: right}
This is header 1
www.fun52.com
This is header 3
[ 可先修改部分代码 再运行查看效果 ]
第 1 2 页
CSS文字属性可用来定义文字的外观
设置文字的颜色 Set the color of the text
This example demonstrates how to set the color of the text.
Examples 实例:
Source Code to Run [www.fun52.com]
h1 {color: #00ff00}
h2 {color: #dda0dd}
p {color: rgb(0,0,255)}
标题一
标题二fun52.com
段落
[ 可先修改部分代码 再运行查看效果 ]
设置文字背景色 Set the background-color of the text
This example demonstrates how to set the background-color of a part of the text.
Examples 实例:
Source Code to Run [www.fun52.com]
span.highlight
{
background-color:yellow
}
This is a text. This is a text. This is a text. fun52.com This is a text. This is a text. This is a text. This is a text. This is a text. This is a text. This is a text.
[ 可先修改部分代码 再运行查看效果 ]
指定相邻字符的间隙 Specify the space between characters
This example demonstrates how to increase or decrease the space between characters.
Examples 实例:
Source Code to Run [www.fun52.com]
h1 {letter-spacing: -3px}
h4 {letter-spacing: 0.5cm}
This is header 1
This is header 4
www.fun52.com
[ 可先修改部分代码 再运行查看效果 ]
对齐文字 Align the text
This example demonstrates how to align the text.
Examples 实例:
Source Code to Run [www.fun52.com]
h1 {text-align: center}
h2 {text-align: left}
h3 {text-align: right}
This is header 1
www.fun52.com
This is header 3
[ 可先修改部分代码 再运行查看效果 ]
第 1 2 页
精彩图集
精彩文章