doudi2431 2016-10-27 10:11
浏览 27

其中包含UL的下拉 - >应该因列表项的数量而扩展

I have a very specific problem with the div in a dropdown.

The <ul> within the dropdown is created by a php-foreach function and the amount of <li> varies.

The width of the dropdown should expand if there are more than one <li>, but not more than four in a row. I have to have margin left/right of 20px, a margin top of 12px and a margin between the <li> of 10px.

I already built it with a fixed width for four or more than four <li> (with nth-child etc) but now I have the order to make it smaller if there are only one or two items in it.

I tried different things but nothing seems to work.

Has anyone an idea how to do this? Thanks in advance!

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
    • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
    • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
    • ¥15 如何在炒股软件中,爬到我想看的日k线
    • ¥15 seatunnel 怎么配置Elasticsearch
    • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
    • ¥15 (标签-MATLAB|关键词-多址)
    • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
    • ¥500 52810做蓝牙接受端
    • ¥15 基于PLC的三轴机械手程序