图形
在 Bootstrap 中使用图形组件显示相关图片和文本的文档和示例。
目录
每当你需要显示一段内容——比如带可选标题的图片时,考虑使用 <figure>。
🌐 Anytime you need to display a piece of content—like an image with an optional caption, consider using a <figure>.
使用包含的 .figure、.figure-img 和 .figure-caption 类为 HTML5 <figure> 和 <figcaption> 元素提供一些基础样式。图中的图片没有明确的尺寸,因此请确保将 .img-fluid 类添加到你的 <img> 上以使其具有响应性。
🌐 Use the included .figure, .figure-img and .figure-caption classes to provide some baseline styles for the HTML5 <figure> and <figcaption> elements. Images in figures have no explicit size, so be sure to add the .img-fluid class to your <img> to make it responsive.
<figure class="figure">
<img src="..." class="figure-img img-fluid rounded" alt="...">
<figcaption class="figure-caption">A caption for the above image.</figcaption>
</figure> 使用我们的文本工具对图表的说明进行对齐非常容易。
🌐 Aligning the figure’s caption is easy with our text utilities.
<figure class="figure">
<img src="..." class="figure-img img-fluid rounded" alt="...">
<figcaption class="figure-caption text-end">A caption for the above image.</figcaption>
</figure> CSS
Sass 变量
🌐 Sass variables
$figure-caption-font-size: $small-font-size;
$figure-caption-color: var(--#{$prefix}secondary-color);