-1

How do I center them, on the same line, with the same width between each other, regardless of the resolution?

<div id="stats">
<div class="box">
    <i class="fas fa-cloud"></i>
    <p>Members</p>
</div>
<div class="box">
    <i class="fas fa-cloud"></i>
    <p>Awards</p>
</div>
<div class="box">
    <i class="fas fa-cloud"></i>
    <p>Countries</p>
</div>
</div>

trk
  • 48
  • 5

2 Answers2

3

You can use flexbox in css for that:

#stats {
  display: flex;
  justify-content: space-evenly;
}
<div id="stats">
  <div class="box">
    <i class="fas fa-cloud"></i>
    <p>Members</p>
  </div>
  <div class="box">
    <i class="fas fa-cloud"></i>
    <p>Awards</p>
  </div>
  <div class="box">
    <i class="fas fa-cloud"></i>
    <p>Countries</p>
  </div>
</div>

Read more about it here.

johannchopin
  • 11,813
  • 8
  • 41
  • 91
0
.stats {
   display:flex;
   justify-content:space-evenly
}

display:flex is a great option.

CgOnvMM
  • 17
  • 1
  • 4