1.id选择器和class选择器
id选择器---
id选择器可以对标有特定id的HTML元素指定特定的样式
HTML元素以id属性设置id选择器,css中id选择器以"#"来定义
例
#para1{
text-align:center;
color:red;
}
<p id = "para1">id选择器</p>
class选择器---
用于描述一组元素的样式,class选择器在HTML中以class属性表示
在css中,类选择器以一个"."号显示
例
1.可在所有的class = "center"中起作用
.center{
text-align:center;
}
2.只在段落中的class = "center"中起作用
p.center{
text-align:center;
}
2.border边框
border-left 设置左边框,一般单独设置左边框样式使用。
border-rigth 设置右边框,一般单独设置右边框样式使用。
border-top 设置上边框,一般单独设置上边框样式使用。
border-bottom 设置下边框,一般单独设置下边框样式使用。
border-color 设置边框颜色。
border-width 设置边框宽度。
border-style 设置边框样式。
none 无边框。
hidden 隐藏边框,IE不支持。
dotted MAC: IE4+ Windows、unix: IE5.5+为点线,否则为实线。
dashed MAC: IE4+ Windows、unix: IE5.5+为虚线,否则为实线。
solid 实线边框
double 双线边框,两条单线与其间隔的和等于指定的border-width的值。
groove 根据border-color的值画3d凹槽。
ridge 根据border-color的值画菱形边框。
inset 根据border-color的值画3d凹边。
outset 根据border-color的值画3d凸边。
例
1.border-botrom:1px dashed #000; 设置1px黑色虚线下边框。
3.margin
设置边界的距离 上右下左
margin-left
margin-rigth
margin-top
margin-bottom