栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

使用Flexbox网格的Bootstrap 4砌体布局

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

使用Flexbox网格的Bootstrap 4砌体布局

这对于标准的Bootstrap 4类几乎是可行的。文档中甚至有一整节关于“证件栏”功能。

从文档中: 只需将CSS包裹在中,就可以使用CSS将 卡片组织成类似于砌体的列

.card-columns
。卡是使用
CSS
列属性而不是flexbox构建的,以便于对齐。卡的排列顺序是从上到下,从左到右。

小心! 您使用信用卡栏的里程可能会有所不同。为防止卡跨列断裂,我们必须将其设置

display: inline-block
column-break-inside: avoid
还不是防弹解决方案。

因此,您要做的就是将

.card
s 包装到这样的
.card-columns
容器中:

<div >  <div >    <div >      <img  src="http://via.placeholder.com/1600x900/483D8B/ffffff?text=Card+1" alt="Card image cap">      <div >        <h5 >Card title that wraps to a new line</h5>        <p >This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>      </div>    </div>    <div >      <blockquote >        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>        <footer >          <small > Someone famous in <cite title="Source Title">Source Title</cite>          </small>        </footer>      </blockquote>    </div>    <div >      <img  src="http://via.placeholder.com/1600x450/9400D3/ffffff?text=Card+2" alt="Card image cap">      <div >        <h5 >Card title</h5>        <p >This card has supporting text below as a natural lead-in to additional content.</p>        <p ><small >Last updated 3 mins ago</small></p>      </div>    </div>    <div >      <blockquote >        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat.</p>        <footer >          <small> Someone famous in <cite title="Source Title">Source Title</cite>          </small>        </footer>      </blockquote>    </div>    <div >      <div >        <h5 >Card title</h5>        <p >This card has supporting text below as a natural lead-in to additional content.</p>        <p ><small >Last updated 3 mins ago</small></p>      </div>    </div>    <div >      <img  src="http://via.placeholder.com/1600x1600/FF1493/ffffff?text=Card+3" alt="Card image">    </div>    <div >      <blockquote >        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>        <footer >          <small > Someone famous in <cite title="Source Title">Source Title</cite>          </small>        </footer>      </blockquote>    </div>    <div >      <div >        <h5 >Card title</h5>        <p >This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>        <p ><small >Last updated 3 mins ago</small></p>      </div>    </div>  </div></div><link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/>


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/575538.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号