gpt4 book ai didi

Primefaces menubar menuitem 宽度

转载 作者:行者123 更新时间:2023-12-04 00:15:39 24 4
gpt4 key购买 nike

我的菜单项有问题
:(

想包括一张照片,但不允许
所以没有它的问题是愚蠢的

我似乎无法更改下拉菜单的宽度,
我在我的脑海中包含了一个样式,并在其中包含了一个宽度属性
每个菜单项,但它们没有任何区别:

<style>
ui-menu .ui-menu-parent .ui-menu-child
{
width: 400px; /* exagerated !! */
}
</style>

当菜单项突出显示时,选择栏的宽度是正确的!

任何线索???,这是一个示例菜单栏
<p:menubar>
<p:submenu label="Menu 1"
style="text-align: left;">

<p:menuitem ajax="false"
action="/Page1"
value="Page 1"
style="width: 350px;"/>

<p:menuitem ajax="false"
action="/too_long_page"
value="Some really long menu text that is far too long"
style="width: 350px;" />

<p:menuitem ajax="false"
action="/too_long_page"
value="Some really long menu text that is far too long"
style="width: 350px;" />

</p:submenu>
<p:menuitem ajax="false"
action="/Page2"
value="Page 2" />
</p:menubar>

最佳答案

如果您希望宽度跟随您的内容,请使用此

ul.ui-menu-child {
white-space: nowrap;
width: auto !important;
}

关于Primefaces menubar menuitem 宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9882722/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com