我想将文字放在每个图标下,而不是在他的右边(如现在)
这是小提琴链接:http://jsfiddle.net/ZLkwt/
#middle {
margin: 0 auto;
width: 1050px;
height: 175px;
margin-top: 89px;
}
#icons {
width: 502px;
height: 68px;
font-size: 11px;
}
.icon_middle {
float: right;
text-align: bottom-center;
width: 100px;
height: 85px;
}
<div id="middle">
<div class="icon_middle"><img src="images/smart_tv.jpg" align="middle">Smart TV</div>
<div class="icon_middle"><img src="images/tablet.jpg" align="middle">Tablet</div>
<div class="icon_middle"><img src="images/iphone.jpg" align="middle"></div>
<div class="icon_middle"><img src="images/android.jpg" align="middle">Android</div>
<div class="icon_middle"><img src="images/pc.jpg" align="middle">Pc</div>
<div class="icon_middle"><img src="images/mac.jpg" align="middle">Mac</div>
<div id="middle_txt">
<h1>dfgdfgdfgd</h1><div id="middle_border"></div><h2> dfgdfgdfgdg </h2>
</div><!--close_middle_txt-->
</div><!--middle-->
最佳答案
#middle {
margin: 0 auto;
width: 1050px;
height: 175px;
margin-top: 89px;
}
.icon_middle {
width:50px;
float: right;
width: 100px;
height: 85px;
}
.icon_middle span {
display:block;
}
<div id="middle">
<div class="icon_middle"><img src="images/bg.png" align="middle"><span>Smart TV</span></div>
<div class="icon_middle"><img src="images/bg.png" align="middle"><span>Tablet</span></div>
<div class="icon_middle"><img src="images/bg.png" align="middle"><span>Tablet</span></div>
<div class="icon_middle"><img src="images/bg.png" align="middle"><span>Android</span></div>
<div class="icon_middle"><img src="images/bg.png" align="middle"><span>Pc</span></div>
<div class="icon_middle"><img src="images/bg.png" align="middle"><span>Mac</span></div>
<div id="middle_txt">
<h1>dfgdfgdfgd</h1><div id="middle_border"></div><h2> dfgdfgdfgdg </h2>
</div><!--close_middle_txt-->
</div><!--middle-->