Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

text below images in a row using bootstrap [closed]

In a row there are 5 images and text below each image which is responsive.but when coded in bootstrap the images are overlapping when window is resized.

how can we align 5 images horizontally in a row with each having text below.

enter image description here

Here is model of images and text.Is there any way to make 5 images with text below in it responsive.

like image 899
diya Avatar asked Jan 18 '16 11:01

diya


People also ask

How do I put text and images side by side in bootstrap?

Bootstrap image and text side by side To create image and text side by side use the grid system property of bootstrap and create 2 columns of span 6-6. Put your image in one column and your text in another. On smaller devices, it will automatically align vertically.

How do I make text go under an image in HTML?

This can be done by enclosing the image and text in an HTML “div”. Then make the position of div “relative” and that of text “absolute”. The absolute elements are positioned relative to their parent (div).


1 Answers

You might need to use <figure> and <figcaption>:

<figure>
  <img />
  <figcaption>Image</figcaption>
</figure>

Snippet

<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<div class="container">
  <div class="row text-center">
    <div class="col-xs-2">
      <figure>
        <img src="http://placehold.it/100?text=IMG" alt="">
        <figcaption>Hello</figcaption>
      </figure>
    </div>
    <div class="col-xs-2">
      <figure>
        <img src="http://placehold.it/100?text=IMG" alt="">
        <figcaption>Hello</figcaption>
      </figure>
    </div>
    <div class="col-xs-2">
      <figure>
        <img src="http://placehold.it/100?text=IMG" alt="">
        <figcaption>Hello</figcaption>
      </figure>
    </div>
    <div class="col-xs-2">
      <figure>
        <img src="http://placehold.it/100?text=IMG" alt="">
        <figcaption>Hello</figcaption>
      </figure>
    </div>
    <div class="col-xs-2">
      <figure>
        <img src="http://placehold.it/100?text=IMG" alt="">
        <figcaption>Hello</figcaption>
      </figure>
    </div>
    <div class="col-xs-2">
      <figure>
        <img src="http://placehold.it/100?text=IMG" alt="">
        <figcaption>Hello</figcaption>
      </figure>
    </div>
  </div>
</div>

Preview:

like image 108
Praveen Kumar Purushothaman Avatar answered Oct 09 '22 23:10

Praveen Kumar Purushothaman