twitter-bootstrap 如何使用彼此相邻的引导卡?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43208023/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to use bootstrap cards next to each other?
提问by Yoh
I am using 'class="card-group"' in bootstrap to make four cards to appear next to each other or to appear together in somethings like a row but i can not make it.
我在引导程序中使用 'class="card-group"' 使四张卡片彼此相邻或一起出现在一行中,但我无法做到。
回答by Lalati
You can also use bootstrap's grid, make a row and divide it, example :
您还可以使用引导程序的网格,排成一行并将其分开,例如:
<div class="row">
<div class="col-sm-6">Card 1</div>
<div class="col-sm-6">Card 2</div>
</div>
See here for more details on this: Grid system - Bootstrap
有关更多详细信息,请参见此处:网格系统 - Bootstrap
回答by Rachel S
Just add .card {display:inline-block;}to make them display in a line.
只需添加.card {display:inline-block;}即可使它们显示在一行中。
This is the official way according to the docs: https://v4-alpha.getbootstrap.com/components/card/#card-columns
这是根据文档的官方方式:https: //v4-alpha.getbootstrap.com/components/card/#card-columns
回答by BraydenGames08
Actually, there's something build in to bootstrap! If you use the "row" class, it will put it in a row!
实际上,有一些内置的东西可以引导!如果使用“row”类,它会将它排成一排!
<div class="row">
Card
Card
</div>

