加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

twitter-bootstrap-4 – 在Bootstrap 4中做什么偏移?

发布时间:2020-12-18 00:28:16 所属栏目:安全 来源:网络整理
导读:我正在关注网页创建教程,教师用“col-sm-offset-1”类创建了一个部门.这对于该类中div的内容有什么作用?这是完整的代码: div class =“col-sm-10 col-sm-offset-1” https://jsfiddle.net/zmtmphtq/ 解决方法 根据bootstrap 4.0 .offset类可用. 1.使用clas
我正在关注网页创建教程,教师用“col-sm-offset-1”类创建了一个部门.这对于该类中div的内容有什么作用?这是完整的代码:

< div class =“col-sm-10 col-sm-offset-1”> https://jsfiddle.net/zmtmphtq/

解决方法

根据bootstrap 4.0 .offset类可用.

1.使用class .offset See bootstrap offset documentaion

<div class="row">
  <div class="col-md-4">.col-md-4</div>
  <div class="col-md-4 offset-md-4">.col-md-4 .offset-md-4</div>
</div>

2.或者使用class .mr(margin-right).ml(mrgin-left),See bootstrap spacing documentaion

`<div class="row">
   <div class="col-4 mr-5">col-4</div>
   <div class="col-4 ml-5">col-4</div>
</div>`

3.或者创建一个您希望偏移量大的空列

`<div class="row">
  <div class="col-4"></div>
  <div class="col">col-4</div>
 </div>`

4.或使用.mr-auto来偏移下一列

`<div class="row">
    <div class="col-4 mr-auto">col-4</div>
    <div class="col-4">col-4</div>
 </div>`

See the code in this codepen

Note: Bootstrap Alpha v4 does not have the .offset class,Make sure to use Bootstrap 4.0.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读