应用col-xs类时,Bootstrap 3不可点击的输入

时间:2016-05-29 11:34:09

标签: css twitter-bootstrap

当我将类col-xs-5应用于我的输入时,它变得无法点击。它只能在小屏幕上无法点击,在大屏幕上它可以正常工作。

 <form action="" method="POST" role="form" class="col-lg-12 clearfix" style="padding: 0px;">




                <div class="form-group col-lg-1 col-lg-offset-0 col-md-1 col-md-offset-0  clearfix col-xs-5" style="padding: 0px;">

                    <label for="">Badrooms</label>

                    <select name="" id="input" class="form-control" style="padding: 2px 2px;" >
                        @foreach([1,2,3,4,5,6,7,8,9,10] as $arr)
                           <option value="">{{{$arr == 10 ? '10 >' : $arr}}}</option>
                        @endforeach
                    </select>
                </div>
                <div class="form-group col-lg-1 col-lg-offset-1 col-md-1 col-md-offset-1   clearfix col-xs-5 col-xs-offset-2" style="padding: 0px;">
                    <label for="">Bathrooms</label>

                    <select name="" id="input" class="form-control" style="padding: 2px 2px;" >
                        @foreach([1,2,3,4,5,6,7,8,9,10] as $arr)
                           <option value="">{{{$arr == 10 ? '10 >' : $arr}}}</option>
                        @endforeach
                    </select>
                </div>


                <div class="form-group col-lg-3 col-lg-offset-2 col-md-3 col-md-offset-2 clearfix" style="padding: 0px;">
                    <label for="">Type</label>

                    <select name="" id="input" class="form-control" style="padding: 2px 2px;" >
                        @foreach(ListingTypeDB::all() as $type)
                           <option value="{{{$type->id}}}">{{{$type->type_name}}}</option>
                        @endforeach
                    </select>
                </div>

                <div class="form-group col-lg-2 col-lg-offset-2 col-md-2 col-md-offset-2 clearfix" style="padding: 0px;">
                    <label for="">Rent/Buy</label>

                    <select name="" id="input" class="form-control" style="padding: 2px 2px;" >

                           <option value="1">Rent</option>
                           <option value="0">Buy</option>

                    </select>
                </div>


             </form>

我尝试将我的表单组片段包装成.row它变得可点击但它会让所有内容变得混乱看到图片:enter image description here

谢谢你。

2 个答案:

答案 0 :(得分:0)

您可以编辑代码,如下所示

<div class="row">
            <div class="form-group col-sm-6" >

             <div class="form-group col-sm-5" >
                        <label for="">Badrooms</label>
                    </div>

                   <div class="form-group col-sm-7" >
                        <select name="" id="input" class="form-control"  >
                            @foreach([1,2,3,4,5,6,7,8,9,10] as $arr)
                               <option value="">{{{$arr == 10 ? '10 >' : $arr}}}</option>
                            @endforeach
                        </select>
                </div>
                <div class="clearfix"></div>
            </div>
            <div class="form-group col-sm-6" >
               <div class="form-group col-sm-5" >
                    <label for="">Bathrooms</label>
               </div>
                <div class="form-group col-sm-7" >
                    <select name="" id="input" class="form-control" >
                        @foreach([1,2,3,4,5,6,7,8,9,10] as $arr)
                           <option value="">{{{$arr == 10 ? '10 >' : $arr}}}</option>
                        @endforeach
                    </select>
                </div>
                    <div class="clearfix"></div>

            </div>
    </div>

        <div class="row">
          <div class="form-group col-sm-6 " >
               <div class="form-group col-sm-5" > 
                    <label for="">Type</label>
                </div>

              <div class="form-group col-sm-7" >  
                    <select name="" id="input" class="form-control" >
                        @foreach(ListingTypeDB::all() as $type)
                           <option value="{{{$type->id}}}">{{{$type->type_name}}}</option>
                        @endforeach
                    </select>
                </div>
                <div class="clearfix"></div>

            </div>

            <div class="form-group col-sm-6 ">
               <div class="form-group col-sm-5" > <label for="">Rent/Buy</label></div>

               <div class="form-group col-sm-7" > <select name="" id="input" class="form-control" >

                       <option value="1">Rent</option>
                       <option value="0">Buy</option>

                </select></div>
                    <div class="clearfix"></div>

            </div>
        </div>

使用这些css类,您的可点击问题已经解决。我附上截图供您参考enter image description here

答案 1 :(得分:0)

对我而言,通过添加:

来解决
                    <div class="clearfix visible-xs-block"></div>

每个col div之后。您可以仅对某些尺寸显示它,我的只有xs可见。你可以看看:

Bootstrap Grid responsive resets