0

I need to add captions under each image. I tried using the

tag and also used the tag but Im not able to get the desired result

   <a href="http://www.sportshub.com.sg/Venues/Pages/OCBC-Aquatic-Centre/aqua-classes.aspx">
  <img style=" float:left; display:inline; border-radius:50%;"  src="d2.jpg" width="350" height="200" alt="bbc news special" hspace="30"/>
  </a>



   <a href="http://www.sportshub.com.sg/community/Pages/ecorider/ecorider.aspx">
  <img style=" float:left; display:inline; border-radius:50%;"  src="d3.jpg" width="350" height="200" alt="bbc news special" hspace="30"/>
  </a>strong text
Mahpooya
  • 529
  • 1
  • 6
  • 18
manasa sidhardhan
  • 251
  • 1
  • 3
  • 7

2 Answers2

0

like this? run code

.text {position:relative;text-align:center;}
.images{display:inline-block;margin-top:10px;}
 <div class="images">
  <a href="http://www.sportshub.com.sg/Venues/Pages/OCBC-Aquatic-Centre/aqua-classes.aspx">
  <img style=" float:left; display:inline; border-radius:50%;"  src="d2.jpg" width="350" height="200" alt="bbc news special" hspace=""/>
  </a>
  <div class="text">
  Strong Text
  </div>
 </div>
 
  <div class="images">
  <a href="http://www.sportshub.com.sg/Venues/Pages/OCBC-Aquatic-Centre/aqua-classes.aspx">
  <img style=" float:left; display:inline; border-radius:50%;"  src="d2.jpg" width="350" height="200" alt="bbc news special" hspace=""/>
  </a>
  <div class="text">
  Strong Text
  </div>
 </div>
cnsvnc
  • 714
  • 6
  • 16
0

Hope it will help you

HTML

<div>
    <img src='image1.jpg' alt='image1' />
    <span class="caption">Caption goes here</span>
</div>

CSS

.caption {
  display: block;
  font-weight: bold;
  margin-top: 10px;
}

Live Demo

Siful Islam
  • 1,906
  • 3
  • 21
  • 31