在 GitHub 上檢視
圖形
Bootstrap 中使用圖形元件顯示相關圖片和文字的文件和範例。
任何時候需要顯示內容(例如帶有標題選項的圖片)時,請考慮使用 <figure>
。
使用內含的 .figure
、 .figure-img
和 .figure-caption
類別,為 HTML5 <figure>
和 <figcaption>
元素提供一些基線樣式。圖形中的圖片沒有明確的大小,因此請務必將 .img-fluid
類別新增到 <img>
,以使其具有回應性。
<figure class="figure">
<img src="..." class="figure-img img-fluid rounded" alt="...">
<figcaption class="figure-caption">A caption for the above image.</figcaption>
</figure>
使用我們的 文字工具程式,可以輕鬆對齊圖形的標題。
<figure class="figure">
<img src="..." class="figure-img img-fluid rounded" alt="...">
<figcaption class="figure-caption text-right">A caption for the above image.</figcaption>
</figure>