background定位的局限(css2.1):只能相对左上角数值定位,不能相对右下角
border-right: 50px solid transparent; // 右侧一个透明的边框
background-position:100% 45px; // 100%右侧定位不计算border区域

background




border




border





可以试着去修改右端的边框样式,在进行定位分析。无论边框怎么变换图片的位置都是相对于右面边框的绝对0位置。
+++++++++++++++++++
background-position:左 上;;;是相对于左上方定位的
background-position
background定位的局限
只能相对于左上角数值定位,不能相对右下
.div1 {
height:200px; width:600px;
border-right:50px solid transparent;
background:100% 30px #ccc url(img/HBuilder.png) no-repeat;
}
background-position定位只能相对于左上角,当需要距离右边缘时,可以用border,因为100%右侧定位不计算border区域
e.g. border-right:50px solid transpanrent;(透明边框) background-position:100% 40px;