Elements with nowrap are bound to neighboring elements in WebKit

I have a list ulthat I show as a horizontal menu. I would like the contents of each to liremain on the same line, but all the elements lito skip lines as needed. Sort of:

First entry in the menu Second menu entry
These words are short, the LI jumps lines, but doesn't wrap
Yet anoter] [And more] [Some more]

Logically, I would just put it li {white-space:nowrap;}, but the problem is with WebKit browsers. Elements with nowrap are attached to adjacent elements. So, in the above case, everyone liwill be on the same line.

The same applies to an isolated c element nowrapinside a wrapper text block.

<p>Visit my sites <a href="http://gabrielradic.com/" style="white-space:nowrap">Gabriel Radic
.com (English)</a> or <a href="http://www.timbru.com/" style="white-space:nowrap">Timbru Blog
(Romanian)</a>.

What I would expect is something like:

Visit my Gabriel Radic.com Sites or
Timbru Blog

, :


Gabriel Radic.com Timbru ()

Safari, Chrome ?

.

+3
2

white-space:nowrap display:inline-block.

CSS , , .

+2

, , , , , ? :

item one | item two | item number | item four 
                         three

:

item one | item two | item number three | 
item four 

, nowrap ul , ul, wrap? , .

0

Source: https://habr.com/ru/post/1698393/


All Articles