Barcat
Barcat

Reputation: 163

Bootstrap using image indead of glyphicon

Is it possible to use image inside bootstrap-min.css

We are using a theme (modern) and some icons are controlled by bootstrap.

I would like to change the following line to use image.

.glyphicon-home:before{content:"\e021"}

Upvotes: 1

Views: 315

Answers (2)

ukdesignservices
ukdesignservices

Reputation: 1

Just clear the content parameter and add your own image using background. The rest of the styles (display:inline-block) should still inherit.

.glyphicon-home:before{
    content: "";
    background: url(IMAGEPATH) 50% 50% no-repeat;
}

Oh - and I wouldn't put it into bootstrap.min.css - add it to a stylesheet that is called later, or your theme's style.css

Upvotes: 0

Victor Levin
Victor Levin

Reputation: 1177

Try this:

.glyphicon-home{
    display:inline-block;
    background-image:url('../images/YOUR_IMAGE.png');
    width:20px;
    height:20px;
}

Upvotes: 1

Related Questions