M
M
mishapsv2018-03-28 13:30:31
css
mishapsv, 2018-03-28 13:30:31

How to vertically align the block following the text?

It was necessary to add a badge in h2, which is sometimes displayed.
Added, aligned with flexbox - excellent.
But if the text goes to a new line, then the badge is already moving to the right.
And without flexbox, you can’t align the badge vertically.
Link https://codepen.io/anon/pen/JLMZvp
Is it possible to do this without wrapping the text in front of the badge with a span?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TheRevan, 2018-03-28
@TheRevan

wrap the badge with a div and set line-height and vetical-align:middle

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question