Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to overlay Glyphicon on image

Tags:

html

css

I can't get my head around how to layer a Glyphicon (.glyphicon- zoom-in) over a Bootstrap .img-thumbnail.

The css rule is - content:"\e015";

like image 727
user3738962 Avatar asked Aug 25 '14 15:08

user3738962


People also ask

How do I overlay images in bootstrap?

Image Overlay: Image overlay generally refers to the image being a background image and inserting texts, and links inside of that image. It can be done using the 'card-img-overlay' property that is present in bootstrap. Also, we can do it with normal CSS along with a bootstrap theme.

How do you put an icon over an image in HTML?

To overlay two elements, one approach is to make a parent position: relative , and then the overlay position: absolute . In this case, this example should work, where the download icon can be any element, such as a bootstrap button. Save this answer.

What can I use instead of Glyphicons?

Free Alternatives to Glyphicons You can use both Font Awesome and Github Octicons as a free alternative for Glyphicons. Bootstrap 4 also switch from Less to Sass so you might integrate the font's Sass (SCSS) into your build process, to create a single CSS file for your projects.


1 Answers

HTML:

<div class="wrapper"><img src="..."><span class="glyphicon glyphicon-leaf"></span><div>

CSS:

.wrapper {
   position: relative;
}

.wrapper .glyphicon {
   position: absolute;
   top: 20px;
   left: 40px;
}

http://jsfiddle.net/idmean/7672Lt7L/1/ Sweet, isn't it?

like image 148
idmean Avatar answered Sep 28 '22 18:09

idmean