<div class="TabListItem">
<div class="ListItem1">
<div class="ItemIcon">
<span class="Icon Icon1"></span>
</div>
</div>
.TabListItem .ListItem1-2{
box-sizing: border-box;
text-align: center;
margin-top: 10px;
margin-left: 82px;
margin-right: 10px;
background-color: #000066;
}
@media(min-width:600px){
.TabListItem .ListItem1-2 .ItemIcon{
width:275px;
}
.TabListItem .ListItem1-2{
box-sizing: border-box;
text-align: center;
margin:10px auto;
text-align: center;
background-color: #000066;
}
}
.TabListItem .ListItem1-2 .ItemIcon{
display: block;
background: url("../images/Mobile_bg0302.png") center center no-repeat;
background-size: 100% 100%;
height: 285px
}
.TabListItem .ListItem1-2 .ItemIcon .Icon1{
display: block;
background: url("../images/Mobile_bg0304.png") center center no-repeat;
background-size: 100% 100%;
height: 285px
}
如何让span图片居中在div中
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
4条回答
- Vivianluolita 2016-11-01 06:27关注
用的 margin: 0 auto 解决
@media(min-width:600px){ .TabListItem .ListItem1-2 .ItemIcon{ width:275px; margin: 0 auto; } .TabListItem .ListItem1-2 .icon2{ box-sizing: border-box; } }
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报