作者:jawshan212 | 来源:互联网 | 2022-12-20 13:19
background:url(imageshh.gif)no-repeat-10px0;},作用是移动背景的位置.背影图片的左上角相对当前元素左上角的坐标。右为X轴正半轴,
background:url(images/hh.gif) no-repeat -10px 0;},作用是移动背景的位置.
背影图片的左上角相对当前元素左上角的坐标。
右为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;}