BlueCat
BlueCat

Reputation: 763

Icon is loaded, but not shown (html, css)

I have an icon which is actually on my webpage but I still cant see it.

HTML

<i class="iconMan"></i>

CSS

.iconMan{
    background-image: url(../../assets/imgs/iconMan.png);
    display: block;
  }

this is what I get:

enter image description here

The Icon should be next to "Test User" but it's not showing. I already tried adjusting height and width but it didn't work. Any suggestions what I could do?

Upvotes: 0

Views: 1117

Answers (3)

Frederik Voordeckers
Frederik Voordeckers

Reputation: 1331

for displaying an icon you can move your styling to the ::after or ::before pseudo selectors.

.iconMan {
    display: inline-block;
}

.iconMan::before {
    content: url(../../assets/imgs/iconMan.png);
}

Upvotes: 1

Kamal Muradov
Kamal Muradov

Reputation: 49

try to do like this

<img src="/assets/imgs/iconMan.png"

I guess it will work just put this to your html code

Upvotes: -1

AVI
AVI

Reputation: 5703

You have missed quotes

.iconMan{
    background-image: url("../../assets/imgs/iconMan.png");
    display: block;
  }

Upvotes: 1

Related Questions