fat fantasma
fat fantasma

Reputation: 7613

How to overlay/embed bootstrap button on image?

I have been searching the web but can't find the answer. Is it possible to overlay or embed a bootstrap button over/in an image? If so, how?

I have a image that I want to overlay a bootstrap button over so it looks like it is embedded in the image. I would like the button to have a dynamic label on it(for ex. somebody's name).

Upvotes: 23

Views: 60454

Answers (1)

fat fantasma
fat fantasma

Reputation: 7613

Stano answered the question for me!

"...yes the button can be positioned above the image tag, for example like this: 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;
}

Upvotes: 33

Related Questions