Answer the question
In order to leave comments, you need to log in
Why does the last inline-block wrap even though there is enough space for it not to wrap?
There is a code: codepen.io/sanns/pen/WQjRoj?editors=110)
I tried to make the menu itself on the right, and the elements to be moved along the left edge. I did so, but for some reason the last element is transferred, although there is enough space for it at high resolutions. Tell me, please, what's the matter? Thank you!
Answer the question
In order to leave comments, you need to log in
suggested on stackoverflow not to set margins as a percentage
codepen.io/sanns/pen/WQjRmM?editors=110
Each browser adds padding to inline-block elements by default, the size of this padding varies depending on the browser.
To avoid this, the closing and opening tag of the element is left on the same horizontal tag, which is styled as an inline block (without a space).
<div class="inline-block-elem">
text
</div><div class="inline-block-elem">
text
</div>
Remove styles from .navg and everything will work. Here:
codepen.io/anon/pen/vNmgQG
Strange, I started formatting your html and the block aligned as it should, it feels like there are non-portable spaces (although they should have been visible in the editor)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question