如何正确使用应用于输入标记的btn-group-justified类

时间:2016-09-05 03:35:31

标签: html twitter-bootstrap

我正在使用bootstrap 3.3.6。 btn-group-justified类适用于链接标记,但不能像我期望的输入标记那样工作。在这种情况下,如何正确应用btn-group-justified类?

见下面的例子:

<form>
    <div class="btn-group btn-group-justified"  id="aaa">
      <a class="btn btn-success" role="">Submit</a>
    </div>
    <div class="btn-group btn-group-justified"  id="bbb">
      <input type="submit" class="btn btn-success" value="Submit">
    </div>
</form>

Output from the html code above

2 个答案:

答案 0 :(得分:0)

&#13;
&#13;
input[type="submit"]
{
  width:100%!important;
}
&#13;
<head>
    <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<form>
    <div class="btn-group btn-group-justified"  id="aaa">
      <a class="btn btn-success" role="">Submit</a>
    </div>
     <div class="btn-group btn-group-justified"  id="bbb">
      <input type="submit" class="btn btn-success" id="submit" value="Submit">
    </div>
</form>
  </body>
&#13;
&#13;
&#13;

答案 1 :(得分:0)

你可以添加style =&#34; width:100%!important&#34;在你的输入