在bootstrap中是否有类似btn-block的输入块样式?

时间:2017-05-03 05:52:18

标签: html css twitter-bootstrap twitter-bootstrap-3

我想通过bootstrap更改输入的宽度,例如具有 btn-block 样式的按钮。为了更好地理解,我从我的项目中拍了一张照片。

   <hr/>
    <div class="container">
        <form class="form-horizontal">
            <div class="form-group">  
                <div class="col-sm-10 col-md-10 col-lg-10 col-sm-offset-2">
                    <input type="email" class="form-control form-control input-lg" id="email" placeholder="Enter number">
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-8">
                    <button type="submit" class="btn btn-default btn-lg btn-block">Submit</button>
                </div>
            </div>
        </form>
    </div>

My project picture

2 个答案:

答案 0 :(得分:1)

像这样更改你的代码

&#13;
&#13;
-(void)viewWillAppear:(BOOL)animated{
[self.view.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];

// Codes for User Interface here 

}
&#13;
&#13;
&#13;

答案 1 :(得分:0)

根据我的理解,您希望输入宽度与按钮宽度相同 看看这个fiddle。希望它能给你这个想法。 form-group类中不需要列类/ div ,它可能无法满足您的需求

为了您的简单,我附上代码......

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
 <div class="container">
   <div class="col-sm-10 col-md-10 col-lg-10 col-sm-offset-2">
        <form class="form-horizontal">
            <div class="form-group">  
              
                    <input type="email" class="form-control form-control input-lg" id="email" placeholder="Enter number">
                </div>
        
            <div class="form-group">
                    <button type="submit" class="btn btn-default btn-lg btn-block">Submit</button>
                </div>
           
        </form>
 </div>

    </div>