简体   繁体   English

col-md-12在col-md-6内部无法正常工作?

[英]Col-md-12 is not working properly inside col-md-6?

Below is my code structure. 下面是我的代码结构。 I am trying to give full width to email column by using col-md-12 class but it's not working. 我正在尝试通过使用col-md-12类为电子邮件列提供完整宽度,但是它不起作用。 I tried adding width:100% manually but still its not working. 我尝试手动添加width:100%,但仍然无法正常工作。

The below is snapshot of how my view looks: 以下是我的视图外观的快照:

在此处输入图片说明

HTML Code Structure: HTML代码结构:

<div class="col-md-6 left-side-border-right"><!-- LEFT Column Containing EQ User Fields Start -->
                                   <div class="row">
                                       <section class="col-md-6">
                                           <label class="label">{{EvaluationClientFrontEndForm.getLabel("first_name")}}</label>
                                           <label class="input">
                                               {{ EvaluationClientFrontEndForm.render("first_name", ["class": "form-control"]) }}
                                           </label>
                                       </section>
                                       <section class="col-md-6">
                                             <label class="label">{{EvaluationClientFrontEndForm.getLabel("last_name")}}</label>
                                             <label class="input">
                                                 {{ EvaluationClientFrontEndForm.render("last_name", ["class": "form-control"]) }}
                                             </label>
                                       </section>
                                   </div>

                                  <div class="row">
                                      <section class="col-md-12">
                                          <label class="label">{{EvaluationClientFrontEndForm.getLabel("email")}}</label>
                                          <label class="input">
                                              {{ EvaluationClientFrontEndForm.render("email", ["class": "form-control"]) }}
                                          </label>
                                      </section>
                                  </div>

                                  <div class="row">
                                        <section class="col-md-6">
                                            <label class="label">{{EvaluationClientFrontEndForm.getLabel("phone")}}</label>
                                            <label class="input">
                                                {{ EvaluationClientFrontEndForm.render("phone", ["class": "form-control"]) }}
                                            </label>
                                        </section>
                                  </div>

                                  <div class="row">
                                      <section class="col-md-6">
                                          <label class="label">{{EvaluationClientFrontEndForm.getLabel("age")}}</label>
                                          <label class="input">
                                              {{ EvaluationClientFrontEndForm.render("age", ["class": "form-control"]) }}
                                          </label>
                                      </section>
                                      <section class="col-md-6">
                                            <label class="label">{{EvaluationClientFrontEndForm.getLabel("gender")}}</label><br>
                                            <input type="radio" name="gender" value="male"> Male
                                            <input type="radio" name="gender" value="female"> Female<br>
                                      </section>
                                  </div>


                                  <div class="row">
                                      <section class="col-md-6">
                                          <label class="label">{{EvaluationClientFrontEndForm.getLabel("current_weight")}}</label>
                                          <label class="input">
                                              {{ EvaluationClientFrontEndForm.render("current_weight", ["class": "form-control"]) }}
                                          </label>
                                      </section>
                                      <section class="col-md-6">
                                            <label class="label">{{EvaluationClientFrontEndForm.getLabel("goal_weight")}}</label>
                                            <label class="input">
                                                {{ EvaluationClientFrontEndForm.render("goal_weight", ["class": "form-control"]) }}
                                            </label>
                                      </section>
                                  </div>

                                  <div class="row">
                                      <section class="col-md-6">
                                          <label class="label">{{EvaluationClientFrontEndForm.getLabel("skype_id")}}</label>
                                          <label class="input">
                                              {{ EvaluationClientFrontEndForm.render("skype_id", ["class": "form-control"]) }}
                                          </label>
                                      </section>
                                  </div>

                            </div><!-- LEFT Column Containing EQ User Fields Ends -->

Let me know if any further details is required! 让我知道是否需要其他详细信息! Any help will be highly appreciated. 任何帮助将不胜感激。 Again Thank you so much. 再次,谢谢你。

Thanks 谢谢

To make it full width, you should use the .btn-block as mentioned in the documentation . 要使其全宽,应使用文档中提到的.btn-block It likely needs to be a block level element in order to be full width. 它可能需要是块级元素才能全宽。

Bootstrap provides some examples. Bootstrap提供了一些示例。 Yours is very similar to "Checkout Form": http://getbootstrap.com/docs/4.1/examples/checkout/ 您的网站与“结帐表格”非常相似: http : //getbootstrap.com/docs/4.1/examples/checkout/

I recommend you take a look at it as it was designed and implemented by the bootstrap team. 我建议您看一下它,它是由引导团队设计和实现的。 You'll find out good practices (when and how to use row, key classes to ensure responsiveness, etc). 您会发现良好的做法(何时以及如何使用行,键类以确保响应能力等)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM