M
M
mxbeat2021-07-20 01:33:09
css
mxbeat, 2021-07-20 01:33:09

How can I prevent an inline-block from wrapping to a new line?

There is a block with links:

<div class="container">
  <a href="#">Текст ссылки текст ссылки</a>
  <a href="#">Текст ссылки</a>
  <a href="#">Текст ссылки текст ссылки текст</a>
</div>

An arrow has been added to each link using the after pseudo-element:
a::after {
  content:'';
  display: inline-block;
  width: 11px;
  height: 11px;
  background: url(../img/arrow.svg) center no-repeat;
}


How can I make the arrow itself not wrap to a new line if it does not fit in the container, but only wrap with the last word, as if there was a non-breaking space between the arrow and the last word? To be like in the last line in the picture:
60f5fd07986c5243508678.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question