div中的CSS垂直对齐按钮不起作用

时间:2015-05-13 12:24:08

标签: html css vertical-alignment

我的CSS按钮不是div底部的垂直对齐,我有以下代码:

<div id="spacebuttons" align="right" style="height: 150px; width:920px; background-color:#6F0; display: inline-block; float:left; vertical-align:bottom">
    <a href="http://www.domain.com/cspace/customerspace.php">
    <img src="images/FontAwesome_f007(0)_32.png" alt="customer space" width="32" height="32" border="0" />
    <button type="button" class="btn btn-default btn-sm" onClick="window.location.href('http://www.domain.com/cspace/customerspace.php')">Customer  Space</button>
    </a>

我做错了什么?css vertical-align

2 个答案:

答案 0 :(得分:0)

为您的锚标记应用Me!txtBox1.Value = Me!lstBox.Column(EnumOfColumns.Price) ,与下面的div高度相同。

line-height

DEMO

答案 1 :(得分:0)

试试这个我为你添加了一些风格,但我不知道你的确切输出

#spacebuttons {
    height: 150px;
    width:96%; 
    padding: 2%;
    background-color: #6F0; 
    float:left; 
}
#spacebuttons a {
    line-height: 32px;
    float: right;
    display: block;
}
#spacebuttons a img {
    float: left;
    margin-right: 5px;
}
<div id="spacebuttons">
    <a href="http://www.domain.com/cspace/customerspace.php">
    <img src="images/FontAwesome_f007(0)_32.png" alt="" width="32" height="32" border="0" />
    <button type="button" class="btn btn-default btn-sm" onClick="window.location.href('http://www.domain.com/cspace/customerspace.php')">Customer  Space</button>
    </a>
</div>