在 Bootstrap v5.0.0-alpha1 中,我可以将什么用于媒体 (BS 3/4)?
In Bootstrap v5.0.0-alpha1 what can I use for media (BS 3/4)?
我想在 Bootstrap v5.0.0-alpha1 中使用媒体对象,但是如何使用?
在 Bootstrap 3 & 4 中,我是这样使用的:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.2/css/bootstrap.min.css">
<div class="container mt-3">
<h2>Media Object</h2>
<p>Create a media object with the .media and .media-body classes:</p>
<div class="media border p-3">
<img src="https://cdn.pixabay.com/photo/2016/11/18/23/38/child-1837375_960_720.png" alt="John Doe"
class="mr-3 mt-3 rounded-circle" style="width:60px;">
<div class="media-body">
<h4>John Doe <small>Posted on February 19, 2016</small></h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua.</p>
</div>
</div>
</div>
在 v5.0.0-alpha1 中,我可以将哪个 class 用于媒体对象?我无法在 Bootstrap 中找到任何名为 'media' 的 class 5.
由于 Bootstrap 在版本 5 中删除了“媒体对象”,您将不得不使用实用程序 类。
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.0/css/bootstrap.min.css"/>
<div class="container mt-3">
<h2>Media Object</h2>
<p>Create a media object without .media and .media-body classes (BS5):</p>
<div class="d-flex border p-3">
<img src="https://cdn.pixabay.com/photo/2016/11/18/23/38/child-1837375_960_720.png" alt="John Doe"
class="flex-shrink-0 me-3 mt-3 rounded-circle" style="width:60px;height:60px;">
<div>
<h4>John Doe <small>Posted on February 19, 2016</small></h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua.</p>
</div>
</div>
</div>
Bootstrap 5 的文档说明了如何使用卡片来实现旧的媒体对象布局。 https://getbootstrap.com/docs/5.0/components/card/#horizontal
例如:
<div class="card mb-3 border-0">
<div class="row g-3">
<div class="col-md-4">
<svg class="bd-placeholder-img" width="100%" height="250" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Image" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#868e96"></rect><text x="50%" y="50%" fill="#dee2e6" dy=".3em">Image</text></svg>
</div>
<div class="col-md-8">
<div class="card-body p-0">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>
</div>
</div>
我想在 Bootstrap v5.0.0-alpha1 中使用媒体对象,但是如何使用?
在 Bootstrap 3 & 4 中,我是这样使用的:
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.2/css/bootstrap.min.css">
<div class="container mt-3">
<h2>Media Object</h2>
<p>Create a media object with the .media and .media-body classes:</p>
<div class="media border p-3">
<img src="https://cdn.pixabay.com/photo/2016/11/18/23/38/child-1837375_960_720.png" alt="John Doe"
class="mr-3 mt-3 rounded-circle" style="width:60px;">
<div class="media-body">
<h4>John Doe <small>Posted on February 19, 2016</small></h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua.</p>
</div>
</div>
</div>
在 v5.0.0-alpha1 中,我可以将哪个 class 用于媒体对象?我无法在 Bootstrap 中找到任何名为 'media' 的 class 5.
由于 Bootstrap 在版本 5 中删除了“媒体对象”,您将不得不使用实用程序 类。
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.1.0/css/bootstrap.min.css"/>
<div class="container mt-3">
<h2>Media Object</h2>
<p>Create a media object without .media and .media-body classes (BS5):</p>
<div class="d-flex border p-3">
<img src="https://cdn.pixabay.com/photo/2016/11/18/23/38/child-1837375_960_720.png" alt="John Doe"
class="flex-shrink-0 me-3 mt-3 rounded-circle" style="width:60px;height:60px;">
<div>
<h4>John Doe <small>Posted on February 19, 2016</small></h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et
dolore magna aliqua.</p>
</div>
</div>
</div>
Bootstrap 5 的文档说明了如何使用卡片来实现旧的媒体对象布局。 https://getbootstrap.com/docs/5.0/components/card/#horizontal
例如:
<div class="card mb-3 border-0">
<div class="row g-3">
<div class="col-md-4">
<svg class="bd-placeholder-img" width="100%" height="250" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Placeholder: Image" preserveAspectRatio="xMidYMid slice" focusable="false"><title>Placeholder</title><rect width="100%" height="100%" fill="#868e96"></rect><text x="50%" y="50%" fill="#dee2e6" dy=".3em">Image</text></svg>
</div>
<div class="col-md-8">
<div class="card-body p-0">
<h5 class="card-title">Card title</h5>
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>
</div>
</div>