Stop floating divs from wrapping

后端 未结 6 745
醉梦人生
醉梦人生 2020-12-04 10:38

I want to have a row of divs (cells) that don\'t wrap if the browser is too narrow to fit them.

I\'ve searched Stack, and couldn\'t find a working answer to what I t

6条回答
  •  無奈伤痛
    2020-12-04 11:18

    The only way I've managed to do this is by using overflow: visible; and width: 20000px; on the parent element. There is no way to do this with CSS level 1 that I'm aware of and I refused to think I'd have to go all gung-ho with CSS level 3. The example below has 18 menus that extend beyond my 1920x1200 resolution LCD, if your screen is larger just duplicate the first tier menu elements or just resize the browser. Alternatively and with slightly lower levels of browser compatibility you could use CSS3 media queries.

    Here is a full copy/paste example demonstration...

    
    
    
    
    XHTML5 Menu Demonstration
    
    
    
    
    
    

    Hover the first menu at the top-left.

提交回复
热议问题