简体   繁体   中英

Only half of my images display. Why?

I want to display four images - two on row one and two underneath.

Only the top row displays for some reason and I just cannot see why.

Here is the very simple code:

<img class="social" src="http://www.c5d.co.uk/racenight.png" alt="Race Night">
<img class="social2" src="http://www.c5d.co.uk/mothersday.png" alt="Mothers' Day>
<p>
<img class="social" src="http://www.c5d.co.uk/carlosax.png" alt="Carlo Sax>
<img class="social2" src="http://www.c5d.co.uk/eastersunday.png" alt="Easter Sunday"></p> 

The web page is: http://www.c5d.co.uk/socialeventsfour.php

Why don't the lower two images display?

Because you forget to close "Mothers' Day and "Carlo Sax on your second and third <img>

Here's the corrected one:

http://jsfiddle.net/ytmvy/2/

<img class="social" src="http://www.c5d.co.uk/racenight.png" alt="Race Night">
<img class="social2" src="http://www.c5d.co.uk/mothersday.png" alt="Mothers' Day">
<p>
    <img class="social" src="http://www.c5d.co.uk/carlosax.png" alt="Carlo Sax">
    <img class="social2" src="http://www.c5d.co.uk/eastersunday.png" alt="Easter Sunday">
</p>
<img class="social" src="http://www.c5d.co.uk/racenight.png" alt="Race Night" />
<img class="social2" src="http://www.c5d.co.uk/mothersday.png" alt="Mothers' Day" />
<p>
  <img class="social" src="http://www.c5d.co.uk/carlosax.png" alt="Carlo Sax" />
  <img class="social2" src="http://www.c5d.co.uk/eastersunday.png" alt="Easter Sunday" />
</p>

You may use /> when using images( img ). Along with the obvious missing " from your alt attribute.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM