-2

I have following problem where two things are over (in y direction) each other. Following figure should clarify what I mean: enter image description here

so the 1 with the circle border (as one item) and the text below (as the other item) should get aligned 'vertically', like the green line is (more or less showing).

The problem is that if I search for vertical alignment, there are only explanations of inline vertical alignment.

Can someone tell me what I have to look for please.

the 'code' looks like this:

<div class="item">
     <span class="badge">1</span> 
     <span class="item-text">Text</span>
</div>

The 1 in the circle is already centered, so the text below should align with the middle of the circle.

OcK
  • 93
  • 13

1 Answers1

1

This is usually called horizontal alignment. Because even though your green line is vertical, the items have to be moved horizontally.

And a simple

.item {
  text-align: center;
}

might be enough to make it happen.

Thomas
  • 174,939
  • 50
  • 355
  • 478