• Item2<...">

    How to save inline items from packaging?

    I have menu items that look like

    <ul>
      <li>Item1<span class="context-trigger"></span></li>
      <li>Item2<span class="context-trigger"></span></li>
      <li>Item3<span class="context-trigger"></span></li>
    </ul>
    

    with CSS, which turns this into a horizontal menu, and JS turns [spanans] into buttons that bring up context menus. Vaguely like this:

    Item1 ^ Item2 ^ Item3 ^
    

    If the menu gets too wide for the width of the browser, it wraps up what I want. The problem is that sometimes it is placed in line breaks before [spanans]. I just want it to break between [li] s. Any ideas?

    +3
    source share
    3 answers

    try using

    white-space: nowrap;
    

    in the CSS definition of your context-trigger class.

    : , patmortech , nowrap , " ". , LI , , span - li. , SPAN css LI.

    +14

    , ( context-trigger ):

    li { white-space:nowrap; }
    
    +3

    If you are floating elements <li>, you should get the desired effect.

    0
    source

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


    All Articles