背景图片位置(一般用于定位一张图片里面的某个小图片)
1 2 3 4 5 |
background-position:30% 70% background-position:300px 25px 示例: |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<style type=”text/css”> #image{ width:15px; height:15px;(注意:给div设置一个宽 高) background-image:url(index-sprite3.4474e462.png);(综合很多图标的一张图片) background-position:-61px -81px;(需要定位的图标位置注意是负值) } </style> |
固定背景图片
1 2 3 4 5 6 7 |
Background-attachment:fixed; border-top-color: transparent; (transparent透明 设置边框透明) border-right-color: transparent; filter:alpha(opacity=50); -moz-opacity:0.5; -khtml-opacity: 0.5; opacity: 0.5; |
(设置背景图片透明度)