admin管理员组文章数量:1298477
How can I set the width of the Semantic UI Search Selection drop down? I need to set the width of Semantic UI Search selection dropdown to the longest element in the dropdown. Any help will be appreciated.
How can I set the width of the Semantic UI Search Selection drop down? I need to set the width of Semantic UI Search selection dropdown to the longest element in the dropdown. Any help will be appreciated.
Share Improve this question edited Mar 13, 2017 at 13:08 Barry Michael Doyle 10.6k32 gold badges96 silver badges159 bronze badges asked Mar 12, 2017 at 16:49 Angular-UserAngular-User 1611 gold badge3 silver badges7 bronze badges3 Answers
Reset to default 11I used a fixed-size wrapper combined with a fluid (expands to fit size of parent) dropdown nested inside of it
<div style="width: 250px;">
<div class="ui fluid dropdown">
<input type="hidden" name="country">
<div class="default text">My Dropdown Text</div>
</div>
</div>
Try setting the min-width
instead of setting the width
. The default is a min-width
of 14em
, so you'll need to override that if you wish to have a smaller width.
Example:
.ui.dropdown.search{
min-width: /*smaller width here*/;
}
Try using the 'compact' attribute as shown below. However it only adjusts the width based on what is selected.
<div class="ui compact selection dropdown">
<i class="dropdown icon"></i>
<div class="text">Compact</div>
<div class="menu">
<div class="item">A</div>
<div class="item">B</div>
<div class="item">C</div>
</div>
</div>
本文标签: javascriptHow to set the width of Semantic UI dropdownStack Overflow
版权声明:本文标题:javascript - How to set the width of Semantic UI dropdown - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738479547a2089061.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论