CSS 引导按钮:拉伸以填充其容器空间

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24226062/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 02:34:53  来源:igfitidea点击:

bootstrap button: Stretch to fill its container space

csstwitter-bootstrapstretching

提问by Murhaf Sousli

I'm using bootstrap buttons, I would like to stretch the dropdown button in the middle to fill the rest of the toolbar space.

我正在使用引导程序按钮,我想拉伸中间的下拉按钮以填充工具栏空间的其余部分。

enter image description here

在此处输入图片说明

HTML (shortened code):

HTML(缩短的代码):

<div class="gallery-toolbar">
    <ul style="padding:0">
   <li><a>Back</a></li>

   <li id="gallery_title">
   <div class="btn-group">
     <a class="btn btn-default"><?php echo $gallery->title ?></a>
     <a class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>
     <ul class="dropdown-menu">some php</ul>
   </div></li>

  <li><a>Slideshow</a></li>

css:

css:

.gallery-toolbar li { list-style:none; display: inline }
.gallery-toolbar li:last-child { float:right }
#gallery-title { ?? }

I have tried the class "btn-group-jastified" but it didn't work at all.

我试过“btn-group-jastified”类,但它根本不起作用。

any ideas?

有任何想法吗?

回答by Milad

Have you tried btn-block?

你试过btn-block吗?

<a class="btn btn-default btn-block"></a>

And try width:100%on

并尝试width:100%

<div class="btn-group" style="width:100%">