一、背景样式
1、背景颜色
background-color:red; 简写:background:red;
*注: ie9以下body设置background-color不起作用,需要用bgcolor
2、背景图片
background-image:url("路径"); 简写:background:url("路径");
*注:标签请求外部资源有三种属性:herf、url、src9
3、背景图片平铺
1)、平铺(repeat):浏览器默认的是平铺
2)、不平埔(no-repeat)
3)、平铺在x轴:background-repeat:repeat-x
平铺在y轴:background-repeat:repeat-y
4、背景大小
background-size:100% 100%;
background:200px 200px;
给body设置大小 留心geright(高)的问题
5、背景位置
background-position:"100px 100px";
*注:背景的位置也可以说是坐标轴,(向上为正,向下为正)
位置的值的种类有:数字、百分比、英文单词(top、bottom、left、right)
6、背景简写
body{
background(背景):#ffffff(颜色) url("图片路径") no-repeat(不平铺) right top(位置);
}
二不平铺、边框样式
1、边框颜色
border-color:red;
2、边框粗细
border-width:2px;
3、边框样式
border-style:solid;
4、边框简写
body{
border:blue 2px dashed;
}
*solid 实线 dashed 虚线
5、边框圆角
border-radius:25px;
*注:后面的值可以是具体的数字或百分比