简体   繁体   中英

p:selectOneMenu with relative width stretches out when resizing browser

When I increase browser's window size (eg changing resolutions from 1024x768 to 1920x1080), the <p:selectOneMenu> becomes from this:

在1024x768之前

to this:

后

I figured out that the problem arises when I add a relative width to the component, eg:

<p:selectOneMenu ... style="width: 30%;">

How can I remove the unnecessary space? I am using PrimeFaces 3.3.1

If you do not want the selectonemenu to stretch while resizing or by its text use

.ui-selectonemenu {
    min-width: 0 !important;
}

Perfectly worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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