背影图片的左上角相对当前元素左上角的坐标。
右为X轴正半轴, 下为Y轴正半轴
当前元素左上角坐标为 0,0
默认图片的左上角正对当前元素的左上角
如果图片想向左移 10px;
background:url(images/hh.gif) no-repeat -10px 0;}
如果图片想向上移 10px;
background:url(images/hh.gif) no-repeat 0 -10px;}
同样
如果图片想向右移 10px;
background:url(images/hh.gif) no-repeat 10px 0;}
做了个图片, 黑色框是要加背景的容器。
css代码: background:url(images/hh.gif) no-repeat -10px -10px;}
background:url(images/hh.gif) no-repeat -10px 20px;}
:号后的由空格分出的4个属性分别是 背景图的
图片url路径 是否重复 向左移动像素 向下移动像素
学习了