div内的Bootstrap垂直按钮

时间:2014-01-19 18:18:27

标签: html css twitter-bootstrap-3

如何将图像放在div的底部?

<body>
    <div class="container">
        <div class="row" style="background-color: yellow; height: 600px;">
            <div class="col-md-6">
                <img src="img.png" alt="alt">
            </div>
            <div class="col-md-6">
                Lorem ipsum
            </div>
        </div>
    </div>
</body>

由于

1 个答案:

答案 0 :(得分:0)

解决方案是:

HTML:

<div class="col-md-6 myclass">
    <img src="img.png" class="bottom" width="300">
</div>

CSS:

    .bottom{
        position:absolute;
        bottom:0;
    }

    .myclass{
        height: 100%;
        position:relative;
    }