D
D
depressionofoleg2018-06-16 14:43:54
css
depressionofoleg, 2018-06-16 14:43:54

How to align text horizontally if the images above it are of different sizes, bootstrap?

<div class="row">
      <div class="col-lg-2 text-center">
        <img src="img/001.png" alt="">
        <p>text1</p>
      </div>
      <div class="col-lg-2">
        <img src="img/002.png" alt="">
        <p>text2</p>
      </div>
      <div class="col-lg-2">
        <img src="img/003.png" alt="">
        <p>text3</p>
      </div>
      <div class="col-lg-2">
        <img src="img/004.png" alt="">
        <p>text4</p>
      </div>
      <div class="col-lg-2">
        <img src="img/005.png" alt="">
        <p>text5</p>
      </div>
      <div class="col-lg-2">
        <img src="img/006.png" alt="">
        <p>text6</p>
      </div>
    </div>

We have 6 columns with pictures, text below them, but since the pictures are of different heights, the text is not horizontally smooth. margin on the text did. the text moved away from the pictures, but still not even horizontally.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lumore, 2018-06-16
@Lumore

https://codepen.io/anon/pen/BVwEeP

A
Andriy Broda, 2018-06-16
@AndriyBroda

https://codepen.io/AndriyBroda/pen/GGMLaQ

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question