amagumori
amagumori

Reputation: 697

CSS - images not displaying

having trouble with a CSS problem, but I can't figure it out. none of my images are displaying, yet they have working urls and the HTML is correct.

there's no image styling, and the image class's only styling is: .postimg { width: 100%; }

problem here:

http://jsfiddle.net/4pmUu/5/

this probably has a really simple solution, but i can't figure out what's wrong..

Upvotes: 0

Views: 91

Answers (4)

Afzaal Ahmad Zeeshan
Afzaal Ahmad Zeeshan

Reputation: 15860

You are using the image tag as:

<i src="http://ruby.colorado.edu/~smyth/Research/Images/Volcanix/MtFuji02.jpg" class="postimg"> this is where the actual error it.

The correct way to do is to write <img... use this:

<img src="http://ruby.colorado.edu/~smyth/Research/Images/Volcanix/MtFuji02.jpg" class="postimg" alt="photo" />

Also please note that, using alt="" is necessary in images, as if the image is not loaded because of some issue, the user will be shown a text about that image.

Upvotes: 0

Hugo Sousa
Hugo Sousa

Reputation: 916

If you substitute <i ...></i> and use it (below) it should work.

<img src="http://ruby.colorado.edu/~smyth/Research/Images/Volcanix/MtFuji02.jpg" class="postimg"/>

Upvotes: 0

dwarduk
dwarduk

Reputation: 959

As far as I can tell, you just have the image tag wrong. <i> is italic text; you want <img> instead. That is, <img src="http://ruby.colorado.edu/~smyth/Research/Images/Volcanix/MtFuji02.jpg" class="postimg" />

Upvotes: 0

luke2012
luke2012

Reputation: 1734

You do not have the correct image tag. To show an image in HTML use the <img> tag.

see http://jsfiddle.net/4pmUu/7/

Upvotes: 1

Related Questions