如何将bootstrap标签设置为自动宽度?

时间:2018-06-16 23:09:52

标签: css twitter-bootstrap

我有从数据源动态生成的引导选项卡,目前我已将选项卡宽度设置为固定宽度,但返回的某些名称比我设置的宽度要长。

有没有办法设置它调整到名称长度的宽度?

IE如果返回的名称是烹饪室,则选项卡应调整为适合它

使用此

生成选项卡
function CreateTabs(data) {
    for (i = 0; i < data.Room.Areas.length; i++) {
        $('#List').append("<li id='" + data.Room.Areas[i].AreaID + "' class='nav-item not-active'><a class='nav-link' href='" + data.Room.Areas[i].AreaName + "' data-toggle='tab'>" + data.Room.Areas[i].AreaName + "</a></li>");
    }
}

1 个答案:

答案 0 :(得分:0)

亲爱的朋友,据我所知,默认选项卡会调整以适应文字。请删除固定宽度并检查此样本。

https://getbootstrap.com/docs/4.1/components/navs/

&#13;
&#13;
-R, --reload <int>

Reload filelist and current image after int seconds. Useful for viewing 
HTTP webcams or frequently changing directories. (Note that the filelist 
reloading is still experimental.)

If an image is removed, feh will either show the next one or quit. 
However, if an image still exists, but can no longer be loaded, feh 
will continue to try loading it.
&#13;
&#13;
&#13;