简体   繁体   English

ReactJS中的语义UI下拉组件最大宽度

[英]Semantic UI Dropdown component max-width in ReactJS

I can't figure out how to set the max-width of the Dropdown component in ReactJS. 我不知道如何在ReactJS中设置Dropdown组件的最大宽度。 I tried with 我尝试过

.Menu Dropdown {
    max-width: 5rem !important;
}

With no luck. 没有运气。 They use way too much space for the text they are showing. 他们为显示的文本使用了过多的空间。 Can someone explain me how to do it? 有人可以解释我该怎么做吗? Thanks. 谢谢。

Adding a fluid prop to the Dropdown component should do the job according to the semantic react docs here . 根据此处的语义反应文档,向Dropdown组件添加fluid道具即可完成这项工作。

Example: 例:

<Dropdown fluid> ... </Dropdown>

Hope this helps. 希望这可以帮助。

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

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