-1

I tried to make several lines of containers, each container has image and text. to do this, I used {float:left} function , but the left side of the images is not vertically consistent to each other like below.

image link:the used codes

image link:the result of the codes

I want to make this like :

(red box) Hello

(blue box) My name is

(green box) Story

(purple box) Song

Please give some advices.

Temani Afif
  • 211,628
  • 17
  • 234
  • 311
Paul
  • 13
  • 2

1 Answers1

0

put your all elements in a div and add display:flex to your new-div item:

<div class="parent">
  <div>
   <div>Hello1</div>
   <div>my Name is</div> 
  </div>
  <div>
   <div>Hello2</div>
   <div>my Name is</div> 
  </div>
</div>

style:

.parent{display:flex;}
HamiD
  • 786
  • 4
  • 19