Bootstrap全宽设计

杰西姆·沙贾汉(Jesemm Shajahan)

我想像div下面的图像一样样式

在此处输入图片说明

我已经设计了一些功能,但它并不完整width,并且还在移动视图中显示了侧面滚动。

请告诉我怎么做width

我的HTML代码

#news_and_cv {
  background: #e6e6e6;
}
#send_cv {
  background: #e6e6e6;
  padding: 25px 0px 20px 0px;
}
#news {
  background: #02bed4;
  padding: 25px 0px 20px 0px;
}
.submit {
  padding: 13px 20%;
  background: #02bed4;
  color: #fff;
  text-transform: uppercase;
  font-size: 18px;
  letter-spacing: 1.5px;
  border: 1px solid #fff;
  text-align: center;
  margin-top: 30px;
}
.submit:hover {
  background: #02bed4;
}
.form-style {
  display: block;
  width: 80%;
  height: 37px;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.42857143;
  color: #555;
  background-color: #fff;
  border: 1px solid #ccc;
}
.attach {
  margin-left: 10%;
  float: left;
}
#send_cv form,
input {
  margin: 0 auto;
}
.news_detail {
  padding: 0px 15px;
  color: #fff;
  margin-bottom: 13px;
  margin-top: 13px;
}
.news_detail p {
  text-align: justify;
  margin-bottom: 20px;
}
.news_detail a {
  color: #fff;
  text-decoration: underline;
}
.head_title_main {
  text-align: center;
  font-family: 'Marcellus';
  font-size: 35px;
  font-variant: small-caps;
  letter-spacing: 2px;
  color: #505050;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<section id="news_and_cv">
  <div class="container">
    <div class="row">
      <div class="col-md-7" id="send_cv">
        <div class="row">
          <div class="col-md-12">
            <div class="head_title_main">Send Your CV</div>
          </div>
        </div>
        <div class="row">
          <div class="col-md-12">
            <form style="text-align:center;">
              <input class="form-style" type="text" placeholder="First Name" />
              <br/>
              <input class="form-style" type="text" placeholder="Last Name" />
              <br/>
              <input class="form-style" type="email" placeholder="Email" />
              <br/>
              <input class="form-style" type="tel" placeholder="Phone" />
              <br/>
              <input class="attach" type="file" /> <span>Attach CV (pdf, doc, docx)</span>
              <br/>
              <input type="submit" class="submit" value="Submit" />
            </form>
          </div>
        </div>
      </div>
      <!--end of col-md-7-->

      <div class="col-md-5" id="news">
        <div class="row">
          <div class="col-md-12">
            <div class="head_title_main">News</div>
          </div>
        </div>
        <div class="row">
          <div class="col-md-12">
            <div class="news_detail">
              <h4>Urgent opening for Electrical Engineering</h4>
              <p>Lorem ipsum dolor amet, consectetur adipite scinelit vestibulum vel quam sitare amet odio ultricies dapbus acer vitae.</p>
              <span>06/06/2016</span>  <span class="pull-right"><a href="#">Read more</a></span>
              <hr>
            </div>

            <div class="news_detail">
              <h4>Urgent opening for Electrical Engineering</h4>
              <p>Lorem ipsum dolor amet, consectetur adipite scinelit vestibulum vel quam sitare amet odio ultricies dapbus acer vitae.</p>
              <span>06/06/2016</span>  <span class="pull-right"><a href="#">Read more</a></span>
            </div>
          </div>
        </div>
      </div>
      <!--End of col-md-5-->
    </div>
  </div>
</section>

迪帕斯

根据bootstrap docs的说明,对于全角,您必须使用.container-fluid而不是在桌面视图中.container限制width:1170px显示。

并清除.rows内部的嵌套.col-md-*否则会导致H-scrollbar

通过使用以下命令删除必须使用xs类的超小型设备中的h滚动条.col-xs-12

#news_and_cv {
  background: #e6e6e6;
}
#send_cv {
  background: #e6e6e6;
  padding: 25px 0px 20px 0px;
}
#news {
  background: #02bed4;
  padding: 25px 0px 20px 0px;
}
.submit {
  padding: 13px 20%;
  background: #02bed4;
  color: #fff;
  text-transform: uppercase;
  font-size: 18px;
  letter-spacing: 1.5px;
  border: 1px solid #fff;
  text-align: center;
  margin-top: 30px;
}
.submit:hover {
  background: #02bed4;
}
.form-style {
  display: block;
  width: 80%;
  height: 37px;
  padding: 6px 12px;
  font-size: 14px;
  line-height: 1.42857143;
  color: #555;
  background-color: #fff;
  border: 1px solid #ccc;
}
.attach {
  margin-left: 10%;
  float: left;
}
#send_cv form,
input {
  margin: 0 auto;
}
.news_detail {
  padding: 0px 15px;
  color: #fff;
  margin-bottom: 13px;
  margin-top: 13px;
}
.news_detail p {
  text-align: justify;
  margin-bottom: 20px;
}
.news_detail a {
  color: #fff;
  text-decoration: underline;
}
.head_title_main {
  text-align: center;
  font-family: 'Marcellus';
  font-size: 35px;
  font-variant: small-caps;
  letter-spacing: 2px;
  color: #505050;
  font-weight: bold;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<section id="news_and_cv">
  <div class="container-fluid">
    <div class="row">
      <div class="col-xs-12 col-md-7" id="send_cv">

            <div class="head_title_main">Send Your CV</div>

            <form style="text-align:center;">
              <input class="form-style" type="text" placeholder="First Name" />
              <br/>
              <input class="form-style" type="text" placeholder="Last Name" />
              <br/>
              <input class="form-style" type="email" placeholder="Email" />
              <br/>
              <input class="form-style" type="tel" placeholder="Phone" />
              <br/>
              <input class="attach" type="file" /> <span>Attach CV (pdf, doc, docx)</span>
              <br/>
              <input type="submit" class="submit" value="Submit" />
            </form>
          </div>
      <!--end of col-md-7-->

      <div class="col-xs-12 col-md-5" id="news">

        <div class="head_title_main">News</div>
        <div class="news_detail">
          <h4>Urgent opening for Electrical Engineering</h4>
          <p>Lorem ipsum dolor amet, consectetur adipite scinelit vestibulum vel quam sitare amet odio ultricies dapbus acer vitae.</p>
          <span>06/06/2016</span>  <span class="pull-right"><a href="#">Read more</a></span>
          <hr />
        </div>

        <div class="news_detail">
          <h4>Urgent opening for Electrical Engineering</h4>
          <p>Lorem ipsum dolor amet, consectetur adipite scinelit vestibulum vel quam sitare amet odio ultricies dapbus acer vitae.</p>
          <span>06/06/2016</span>  <span class="pull-right"><a href="#">Read more</a></span>
        </div>
      </div>
    </div>
  </div>
  <!--End of col-md-5-->

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章