用图片定位html背景
2017-03-01 15:58
246 查看
background:url(../images/pub_goods.png) no-repeat 0px 0px;//引入图片路径,图片不重复显示,这里no-repeat后面的两个参数表示的是背景图片的边距
background-size: auto 200px;//将背景图片压缩为200px,比如原图的图标尺寸一般会比较大,这时就需要用到background-size参数缩小图片
background-position:0px -110px;//定位当前元素的背景图片,第一个参数为x横坐标,第二个参数为y纵坐标,一般横纵坐标都是负数开始
贴代码
<div class="head-right"> <div class="more"> </div> </div> //css代码 .head-right { width: 15%; height: 45px; float: left; } .more { width: 100%; float: right; height: 45px; background:url(../images/pub_goods.png) no-repeat; background-size: auto 200px; background-position:0 -110px; }
相关文章推荐
- html/css教程:背景图片的定位问题详解
- Html+Css CSS中背景图片定位方法
- html/css教程:背景图片的定位问题详解
- html背景图片定位方法
- (转)HTML&CSS——background: url() no-repeat 0 -64px;CSS中背景图片定位方法
- HTML&CSS——background: url() no-repeat 0 -64px;CSS中背景图片定位方法
- CSS:html/css教程:背景图片的定位问题详解
- 关于背景图片固定 不会随着页面滚动而变化,及定位注意问题
- CSS 多图片融合背景定位的应用于优缺点分析
- CSS网页设计:百分比进行背景图片定位
- 让IE6支持png半透明图片(支持背景平铺、定位)
- Mini2440更改LCD背景图片 ZHUANZI:http://blog.chinaunix.net/u3/96428/showart_2091031.html
- CSS中背景图片定位方法
- HTML中为button添加背景图片
- HTML控件Input(File)中如何把浏览按钮的背景更换成图片
- background-position背景图片定位,图片位置计算问题
- css 背景图片定位在菜单效果中的应用实例
- CSS背景图片精确定位
- CSS给背景图定位http://www.cniter.com/tech/css/10049_1.html
- css实现对背景图片的定位,获得一张图片上不同位置的内容