如何在图像上叠加/嵌入引导按钮?

时间:2013-05-17 17:59:19

标签: html css twitter-bootstrap

我一直在网上搜索但找不到答案。是否可以在图像上/中覆盖或嵌入引导按钮?如果是这样,怎么样?

我有一个图像,我想覆盖一个自举按钮,所以看起来它嵌入在图像中。我希望按钮上有一个动态标签(例如某人的名字)。

1 个答案:

答案 0 :(得分:28)

斯塔诺为我回答了这个问题!

“...是的按钮可以放在图片标签上方,例如:http://jsfiddle.net/ubWuX

<强> HTML:

<div id="img_container">
    <img src="http://jsfiddle.net/img/initializing.png"/>
    <button class="button"> click here </button>
</div>

<强> CSS:

#img_container {
    position:relative;
    display:inline-block;
    text-align:center;
    border:1px solid red;
}

.button {
    position:absolute;
    bottom:10px;
    right:10px;
    width:100px;
    height:30px;
}