码迷,mamicode.com
首页 > Web开发 > 详细

css 两个图层 响应跳动

时间:2014-08-28 17:50:15      阅读:232      评论:0      收藏:0      [点我收藏+]

标签:style   os   io   ar   div   sp   on   size   c   

<!--有图片的就要有内容 background:url(images/123.jpg); 加载背景 background-size 100% 400px; 宽度本身第一层就可以定义 高度以第二层div高度为限制 background-repeat: no-repeat;只显示一张图片 background-position:center;图片居中 -->
<div style="background:url(images/123.jpg);background-size: 100% 400px;background-repeat: no-repeat;background-position:center;">
<!-- 宽度以父类为标准 外层图片的大小-->
<div style="width:90%;height:500px;text-align: center;">
<!-- <img src="1111.jpg" style="margin:0 auto;margin-top:100px" width="20%" height="260px" > -->
<!-- 用百分比 第二层图片自适应 -->
<div style="background-position:center;background-image:url(images/1111.jpg);background-size: 20% 300px;background-repeat: no-repeat; ">
<!-- 设置内部图片大小 -->
<div style="width:500px; height:500px"></div>
</div>
</div>
</div>

效果

 

bubuko.com,布布扣

css 两个图层 响应跳动

标签:style   os   io   ar   div   sp   on   size   c   

原文地址:http://www.cnblogs.com/bigcatllt/p/3941939.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!