作业帮 > 综合 > 作业

background:url(../images/list01.png) no-repeat 0 center;是什么意

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/18 21:36:15
background:url(../images/list01.png) no-repeat 0 center;是什么意思
background:url(../images/list01.png) no-repeat 0 center;
background:url(../images/bg.png) no-repeat -4px -3px;
这里面的后面两个值是什么意思0 center和 -4px -3px?
ackground:url(../images/list01.png) no-repeat 0 center;
的意思是 图像地址 不重复 水平位置0 垂直位置居中
0 center 的意思就是 水平位置0 垂直位置居中
-4px -3px 的意思就是 水平位置-4px 垂直位置-3px
这两个值和background-position 属性是一样的,即设置背景图像的起始位置.
这个属性设置背景原图像的位置,背景图像如果要重复,将从这一点开始.
默认值:0% 0%
可能的值
top left
top center
top right
center left
center center
center right
bottom left
bottom center
bottom right (以上,如果您仅规定了一个关键词,那么第二个值将是"center".)
x% y% ( 第一个值是水平位置,第二个值是垂直位置.左上角是 0% 0%.右下角是 100% 100%.如果您仅规定了一个值,另一个值将是 50%.)
mpx npx (第一个值是水平位置,第二个值是垂直位置.左上角是 0 0.单位是像素 (0px 0px) 或任何其他的 CSS 单位.如果您仅规定了一个值,另一个值将是50%.)
您可以混合使用 % 和 position 值.