O
O
OblivionGM2021-06-14 14:30:50
Layout
OblivionGM, 2021-06-14 14:30:50

How to make statistics in css?

The template has such statistics (see photo), and the values ​​on the right side are leveled.
How to implement this in css? margin and padding I think will not work, since the text can change and accordingly everything will fly, and if it is divided into two divs and aligned, then there is no binding to each other, it can also jump, I think. How would you advise to do what is the correct approach to such things?

PS I'm just learning, I understand that some points in the question may sound silly. I marked the distance with red lines.
60c73d0bc8fe1597532450.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SotickYoker, 2021-06-17
@SotickYoker

<ul class="wrap">
  <li>
    <p>Учеников:</p>
    <p>290</p>
  </li>
  <li>
    <p>Успешно закончили курс:</p>
    <p>190</p>
  </li>
</ul>

ul{
  list-style-type: none;
  width: 50%;
  background: #000;
  margin: 0;
  padding: 10px;
}

li{
  display: flex;
  justify-content: space-between; 
  color: #fff;
}

Here is a good article - it will come in handy:
https://tpverstak.ru/flex-cheatsheet/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question