返回

css3基础

属性选择器:在p标签中随意定义选择器名称如sb="a",在样式中将名称用[]括起来在加入{}后把属性写在里面。

如果是两个p则可以第一个在样式中不指定名字第二个指定,效果如下。

background详见11

css文本:color、direction、line-height、letter-spacing、text-align、text-decoration、text-indent、text-transform、unicode-bidi、white-space、word-spacing

color共三种值color:red;color:#00ff00;color:rgb(0,0,255);

direction该属性有两个值ltr文本方向从左到右rtl文本方向从右到左

text-align对齐元素中的文本四个值left right center justify

unicode-bidi设置文本方向

text-indent通过使用负值和padding可以替代pre标签

text-transformuppercase全部大写capitalize首字母大写lowercase全部小写

white-space元素中空白的处理方式详细请参考链接

letter-spacing字母和汉字的间距

word-spacing单词的间距

text-decorationblink闪烁的文本(只有火狐支持)overline文本上边有一条线line-through删除线

line-height属性设置行间的距离

font-family规定元素的字体系列

font-styleitalic和oblique

font-size属性可设置字体的尺寸

font-variant属性设置小型大写字母的字体显示文本

font-weight属性设置文本的粗细

@font-face自定义字体

a:link默认链接样式a:visited访问后a:hover鼠标经过a:active按住不放,当四个属性一起使用时需按顺序

list-style详见09