html - Bootstrap - 定制卡片

标签 html css twitter-bootstrap twitter-bootstrap-4 bootstrap-4

我正在开发一个使用 Bootstrap 4 Alpha 的应用程序。我正在尝试创建一些 cards 。我正在尝试在this site上重新创建看起来像类(class)卡的东西。但是,我正在尝试使用默认的 Bootstrap 样式。换句话说,我正在尝试创建一张如下所示的卡片:

+------------------------------------------------------------+
| [icon]                                          04.07.2016 |
+------------------------------------------------------------+
| intro                                                      |
| heading                                                    |
| a description that takes a couple of lines. It may         |
| have two or three lines of text and they'll wrap           |
| like this.                                                 |
|                                                            |
| [tag 1] [tag 2]                                            |
+------------------------------------------------------------+

我一直在尝试重新创建这个here 。日期与图标不在同一行。我的代码如下所示:

<br>
<div class="container">
  <div class="card">
    <div class="card-header">
      <i class="fa fa-circle"></i>
      <div class="text-xs-right">04.07.2016</div>
    </div>
    <div class="card-block">
      <div class="text-muted">intro</div>
      <h4 class="card-title">Heading</h4>
      <p class="card-text"> a description that takes a couple of lines. It may have two or three lines of text and they'll wrap like this.</p>
      <ul class="list-inline text-muted">
        <li class="list-inline-item"><i class="fa fa-tag"></i> tag 1</li>
        <li class="list-inline-item"><i class="fa fa-tag"></i> tag 2</li>        
      </ul>
    </div>
  </div>
</div>

我做错了什么?

最佳答案

对于 Bootstrap 4,它看起来像..

<div class="container">
  <div class="card">
    <div class="card-header">
      <i class="fa fa-circle"></i>
      <div class="pull-xs-right">04.07.2016</div>
    </div>
    <div class="card-block">
      <div class="text-muted">intro</div>
      <h4 class="card-title">Heading</h4>
      <p class="card-text"> a description that takes a couple of lines. It may have two or three lines of text and they'll wrap like this.</p>
      <ul class="list-inline text-muted">
        <li class="list-inline-item"><i class="fa fa-tag"></i> tag 1</li>
        <li class="list-inline-item"><i class="fa fa-tag"></i> tag 2</li>        
      </ul>
    </div>
  </div>
</div>

更新的 Bootply:http://www.bootply.com/2EY9ZfMrdl

编辑 - 从 BS4 alpha 6 开始,pull-right 已更改为 float-right

关于html - Bootstrap - 定制卡片,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36476918/

相关文章:

html - 如何使列表项内的链接占用整个列表项空间?

html - Chrome、Opera 和 Safari 中的奇怪渲染问题

javascript - jQuery 页面滚动不会将导航栏 href 更改为事件类

css - 使 Bootstrap 跨度填充容器高度

jquery - 使用 btn-group 时,单选按钮值未正确发送

html - 使用 Bootstrap 导航栏在移动设备中不显示汉堡包和下拉菜单

css - 如何在较小的屏幕上将一行 6 个图像变成 2 行 3 个图像

jQuery 在 .animate 之后多次更改颜色和文本

html - 按钮后的 CSS 怪异破折号

c# - HTML5 电子邮件输入无法分配 ID 和 RUNAT ="Server"ASP.NET 4