Bootstrap 3列和输入字段

时间:2018-03-11 19:37:45

标签: html css twitter-bootstrap-3

如何拉伸输入文本以适应父引导列的所有宽度?

<div class="col-md-4 col-md-offset-5">
  <span class="pull-right">
  <div class="row buttons-block">
    <div class="col-md-8">              
      <input type="text" class="form-control name-pull-image">              
    </div>
    <div class="col-md-4">
      <button type="button" class="btn btn-block btn-primary pull-image-button">Pull Firmware</button> 
    </div>
  </div>
  </span>
</div>

DevTools screen

3 个答案:

答案 0 :(得分:0)

试试这个:

<div class="col-md-12 col-md-offset-5">
            <span class="pull-right">
                <div class="row buttons-block">
                    <div class="col-md-10">
                        <input type="text" class="form-control name-pull-image">
                    </div>
                    <div class="col-md-2">
                        <button type="button" class="btn btn-block btn-primary pull-image-button">Pull Firmware</button>
                    </div>
                </div>
            </span>
        </div>

答案 1 :(得分:0)

为什么不把'#34;拉右'&#34;在div本身内而不是把它放在跨度内?

&#13;
&#13;
let Pokedex = require('pokedex-promise-v2');
let Poke = {};
Poke["pokedex-promise-v2"] = new Pokedex()
Poke["pokedex-promise-v2"].getPokemonByName('eevee') // with Promise
.then(function (response) {
    console.log(response);
})
.catch(function (error) {
    console.log('There was an ERROR: ', error);
});
&#13;
&#13;
&#13;

答案 2 :(得分:0)

我使用以下代码解决了这个问题:

<div class="col-md-5">
  <snan class="input-group pull-right" style="width: 99%;">
    <input type="text" class="form-control name-pull-image">
    <span class="input-group-addon btn-primary btn-block btn-flat pull-image-button" style="width: 70px;">Pull Firmware</span>
  </span>
</div>