简体   繁体   English

CSS: <li> 并排?

[英]CSS: rows of <li> side by side?

I'm trying to create a dropdown menu using CSS. 我正在尝试使用CSS创建一个下拉菜单。

The only difference is that I need to put two different rows of submenu side by side in one dropdown menu. 唯一的区别是,我需要在一个下拉菜单中并排放置两行不同的子菜单。

To explain this I have attached an image so you can see what i mean: 为了解释这一点,我附上了一张图片,以便您可以了解我的意思:

在此处输入图片说明

Could someone please advise on this? 有人可以为此提供建议吗?

So you need to put 2 different columns side by side. 因此,您需要并排放置2个不同的列。 This can be done by floating the column on the left and giving a margin-left to the column on the right. 这可以通过以下方式完成:将左侧的列浮动,然后在右侧的列中留出一个左边距。

 .col-left{ width:200px; float:left; border:1px solid red; } .col-right{ margin-left: 200px; width:200px; border:1px solid blue; } 
  <div class="col-left"> <ul class="list"> <li>first row</li> <li>second row</li> <li>third row</li> </ul> </div> <div class="col-right"> <ul class="list"> <li>first row</li> <li>second row</li> <li>third row</li> </ul> </div> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM