比如:
pic_box{width:300px; height:300px; background-color:#beceeb; font-size:0; font-size:200px; text-align:center; }
pic_box img{vertical-align:middle;}
pic_box:after{display:inline-block; width:0; height:100%; content:"center"; vertical-align:middle; overflow:hidden;}
html:
<div class="pic_box">
<img src="" />
</div>关于如何设置 DIV 背景,如下例子:如果是背景重复就把no-repeat改为repeat
div{background:url(images/1jpg) no-repeat;}<div style="width:960px;overflow-x:scroll">
<div style="width:2280px">
<img src="1jpg" width="760" height="100"/>
<img src="2jpg" width="760" height="100" />
<img src="3jpg" width="760" height="100"/>
</div>
</div><style>
select {width: 180px;height: 120px;display: block;background: url(selectpng);z-index:1000;}
</style>
<ul>
<li>
<label id="Item_1" class="select">
<img src="picjpg" />
</label>
</li>
</ul>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)