0
 <div class="carousel-inner">
   ...
   <ul class="dropdown-menu">
    <li>...</li>
    <li>...</li>
    <li>...</li>
    <li>...</li>
   </ul>
</div>

我在 div 标签中有 4 个元素,但只显示了 2 个。如何增加它的高度显示所有下拉项目。

我用过溢出:自动;但这是向整个父元素添加滚动,看起来不太好。padding-bottom 也可以在这里工作,但它在不需要的 dropdwn 后面扩展了父级的背景。

fuelux .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1000;
  width: 23%;
  min-width: 50px;
  display: block;

}

 .fuelux .carousel-inner {
   position: relative;
   width: 100%;
   overflow: hidden;
   line-height: 1;
 }
4

2 回答 2

1

I am also facing the same problem until few minutes ago and below is what solved my issue.

style="min-height:300px;max-height:100%;"


You need to set the min-height of parent div to expanded child menu height size so that the child menu will be displayed with out cutting off by the parent height.

We are setting max-height so that CSS won't consider min-height as the default fixed height of the component. so that it will expand if you are using any Dynamic loading content like GroupBoxes, Choosen boxes with long list, etc.,.

   <div class="carousel-inner" style="min-height:300px;max-height:100%;">
   ...
   <ul class="dropdown-menu">
    <li>...</li>
    <li>...</li>
    <li>...</li>
    <li>...</li>
   </ul>
</div>

Note : For the Menu i am loading 300px is the maximum height required to load complete child menu. Check your height of expanded menu size and change it with min-height value to get desired result.

于 2017-10-13T13:00:39.643 回答
0

您是否将高度设置为 div-wrapper?

如果是,则将高度从样式表中删除,高度由 div-wrapper 内的内容自动设置。

例如:

风格:

div {
width: 200px; float: left;
}

ul li {
height: 20px; width: 200px; float: left;
}

当 ul 中有 4 个元素时,div-wrapper 的高度将为 80px。

我希望我能帮助你;)

于 2013-09-04T11:53:08.017 回答