1:background-color:red;
2:
网页中图片的展示形式:img标签导入的图片 背景图(背景图不占据空间);
background-image: url();
背景图默认显示状态:
a:当背景图小于容器尺寸 : 平铺;
b:当背景图等于容器尺寸 : 一张;
c:当背景图大于容器尺寸 : 只显示容器区域;
3:控制背景图是否平铺以及平铺状态
background-repeat:;
属性值:
repeat 平铺(默认值)
no-repeat 不平铺
repeat-x
repeat-y
4:
background-position:左右位置(left/right/center) 上下位置(top/bottom/center);
第一个属性值:正值往右 负值往左
第二个属性值:正值往下 负值往上
复合式写法:
background:pink url(images/dog.png) no-repeat left bottom;
5:
背景图的固定
background-attachment:;
属性值:
fixed 固定
scroll 滚动
border:10px solid red;
border-width:10px;
border-style:solid;
border-color:red;
1:线性: solid(实线) dashed(虚线) dotted(点状线) double(双线) none/0(没有边框)
2:给单一一个方向添加边框:
border-left/right/top/bottom:10px solid yellow;
3:边框设置方法;
border:solid red;
border-width:;
一个值:四周
两个值:上下 左右
三个值:上 左右 下
四个值:上右下左
4:transparent; 代替颜色值 为 透明
border和css的背景属性
最新推荐文章于 2023-06-04 01:55:08 发布