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).
Set the position property value for the parent to relative (to control overlap) and that of the button DIV to absolute . Now place your button inside the button DIV , then use negative values for left , right , top or bottom to position the button DIV where you want.
Just set the div in which you want the other div placed to position:relative; and then place the overlay div with position:absolute; and top , right , etc. where you need it.
To add a button to an image, first, take a <div> element and use position: relative property to it. Set the width of the container and add an image with width: 100% so that the image covers the whole container. Now add a <button> with position: absolute to place it over the image.
To add a play button overlay, upload your photo or drag n drop it to the editor. Next, click on the “Icons” tool located at the left sidebar of the editor. Search for the keyword 'play button' and choose from a wide range of icons for your image. After you're done, download the image in multiple file formats.
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;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With