如何在HTML中加CSS
1、在外部链接样式
link:<link type="text/css" rel="stylesheet" href="路径">
2、嵌入式
<style type="text/css">内容</style>
3、内链式
<a style="color: red"></a>
CSS的定位
float
CSS文本
1、text-indent 缩进段落文本
2、text-align 水平居中
3、justify 在段落文本中两端对齐
4、word-spacing 字与字之间的间隔
5、letter-spacing 字母与字母之间的间隔
6、text-transform 处理英文的大小写有4个值:none uppercase lowercase capitalize
7、text-decoration 文字的装饰
8、white-space 处理空白符有5个值:nowrap pre pre-line pre-wrap normal
9、direction 改变书写方向有两个值:ltr rtl
10、color 设置颜色
11、line-height 设置行高(一般设置上下居中)
CSS伪类
1、:link 未访问的链接
2、:visited 已访问的链接
3、:hover 鼠标光标移动到标签上
4、:active 选定的链接
CSS伪元素
1、:first-line 首行设置特殊样式
2、:first-letter 首字母设置特殊样式
3、:before 当前的内容前面插入新内容
4、:after 当前的内容之后插入新内容
1、在外部链接样式
link:<link type="text/css" rel="stylesheet" href="路径">
2、嵌入式
<style type="text/css">内容</style>
3、内链式
<a style="color: red"></a>
CSS的定位
float
CSS文本
1、text-indent 缩进段落文本
2、text-align 水平居中
3、justify 在段落文本中两端对齐
4、word-spacing 字与字之间的间隔
5、letter-spacing 字母与字母之间的间隔
6、text-transform 处理英文的大小写有4个值:none uppercase lowercase capitalize
7、text-decoration 文字的装饰
8、white-space 处理空白符有5个值:nowrap pre pre-line pre-wrap normal
9、direction 改变书写方向有两个值:ltr rtl
10、color 设置颜色
11、line-height 设置行高(一般设置上下居中)
CSS伪类
1、:link 未访问的链接
2、:visited 已访问的链接
3、:hover 鼠标光标移动到标签上
4、:active 选定的链接
CSS伪元素
1、:first-line 首行设置特殊样式
2、:first-letter 首字母设置特殊样式
3、:before 当前的内容前面插入新内容
4、:after 当前的内容之后插入新内容