U
U
unlik2018-03-15 01:56:31
css
unlik, 2018-03-15 01:56:31

What's the bug with :after?

The same code.
First, here https://jsfiddle.net/8w7hqqhe/2/
Displayed joxi.ru/vAWYaWzU18PGQm
As you can see, there is a space between the link and :after.
Then I add the same code to the html file, open it joxi.ru/brR8WgzuJxPNp2
And there are no spaces.
What could be the problem?
UPD: If this block is in one line in the code

<li class="breadcrumbs__item"><a href="#" class="breadcrumbs__item-link">Главная</a></li>

then there is no gap.
If broken down by lines
<li class="breadcrumbs__item">
     <a href="#" class="breadcrumbs__item-link">Главная</a>
</li>

then he appears.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Nesmeyanov, 2018-03-15
@unlik

Because spaces affect the layout of inline elements .
0 spaces in the code: 0 resulting in
1 space in the code: 1 resulting in
2 spaces in the code: 1 resulting in
3 spaces in the code: 1 resulting in
4 spaces...
In short, magic *whoop*

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question