Search code examples
htmlcssvertical-alignment

CSS vertical align button in div not working


My CSS button is not vertical aligning at the bottom of the div, I've got the following code:

<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>

What am I doing wrong?css vertical-align


Solution

  • Try This I have added some style for you but i don't know about you exact Output

    #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>