我的HTML5 / CSS呈现方式如下:http://imgur.com/0rixh
使用以下代码:
<li>
<div class="name">Booger Jet.zip</div>
<progress max="100" value="60"></progress>
<div class="control"></div>
<div class="status">12 MB / 21 MB 240 kB/s</status>
</li>
#uploads li progress {
width: 317px;
margin-bottom: 4px;
}
#uploads li .control {
width: 14px;
height: 14px;
display: inline-block;
opacity: 0.6;
background-image: url('../img/stop_button.png');
}
如何垂直对齐它们?我有什么选择?谢谢!
答案 0 :(得分:1)
试试吧
#uploads li progress {
width: 317px;
margin-bottom: 4px;
margin-top:1px; /* change it if you need more top sapce*/
}
#uploads li .control {
width: 14px;
height: 14px;
display: inline-block;
vertical-align:top;
opacity: 0.6;
background-image: url('../img/stop_button.png');
}
答案 1 :(得分:0)
您可以使用 vertical-align:middle 。
#uploads li .control, #uploads li progress{
display:inline-block;
vertical-align:middle;
}