コンポーネント(3): カード
Some quick example text to build on the card title and make up the bulk of the card's content.
Go somewherediv.card 属性
以下の書式設定はカード用だが、他の目的にも使用できる。
ボディ(本文)は全体を div.card-body で囲む。
div.card
div.card-body
This is some text within a card body.カード用の書式設定: まとめて示す。
Some quick example text to build on the card title and make up the bulk of the card's content.
Card linkAnother link(h1|h2|h3...).card-title (上例は h5.card-title )(h1|h2|h3...).card-subtitle (上例は h6.card-subtitle )(a).card-link(p).card-textimg.card-img-topでカード上部に配置する。
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card
img.card-img-topdiv.card-bodyこの場合は div.card-body の中ではなく兄弟要素として用いることに注意。より詳しくは画像の設定を参照。
ul.list-group.list-group-flush
li.list-group-itemdiv.card
div.card-header (次のリストに上下密着して配置)組み合わせ例
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card
img.card-img-topdiv.card-body : 内部に次の4つを積み重ね
h5.card-titlep.card-textul.list-group.list-group-flusha.card-link (×2, 横並びに配置) 属性
href="..."Card linka.card-link基本構造( .card-body の中ではなく、最初または最後の兄弟として設定)
ヘッダのみの基本例( Featured の部分)
With supporting text below as a natural lead-in to additional content.
Go somewhereヘッダテキストを h5.card-header で太く表示
With supporting text below as a natural lead-in to additional content.
Go somewhereボディに blockquote による引用文を用いた例
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
ヘッダ/フッタ両方設定、さらに .text-center でセンタリング
With supporting text below as a natural lead-in to additional content.
Go somewherediv.card はデフォルトでは幅いっぱい(親に対し100%)に割り当てる。幅の設定(調整)には様々な方法がある。
レスポンシブ設定の例: mdブレークポイント(768px)で1行2列と2行1列を切り替え
With supporting text below as a natural lead-in to additional content.
Go somewhereWith supporting text below as a natural lead-in to additional content.
Go somewherediv.row
div.col-md-6
div.card
div.col-md-6
div.card
.w-(25|50|75|100) を用いた幅設定 (⇒ サイズユーティリティ )
div.card.w-75
div.card.w-50
style="..." による幅設定
div.card + style="width: 16rem;"
div.card + style="width: 24rem;"
テキストユーティリティ .text-(left|center|right) を用いた配置(⇒ テキスト - アラインメント )
div.card.text-left (デフォルト)
With supporting text below as a natural lead-in to additional content.
Go somewherediv.card.text-center
With supporting text below as a natural lead-in to additional content.
Go somewherediv.card.text-right
With supporting text below as a natural lead-in to additional content.
Go somewhereナビゲーション コンポーネントとの組み合わせ例
ul.nav.nav-tabs.card-header-tabs
Some quick example text to build on the card title and make up the bulk of the card's content.
Go somewhereul.nav.nav-pills.card-header-tabs
Some quick example text to build on the card title and make up the bulk of the card's content.
Go somewhereヘッダやフッタに画像を用いる場合は img.card-img-(top|bottom) を設定する。
img.card-img-bottom
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Last updated 3 mins ago
img.card-img-bottom
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
Last updated 3 mins ago
画像内へテキストをオーバーレイ表示するには div.card-img-overlay を用いる。
色ユーティリティ を用いる。
div.card.text-white.bg-primary
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card.text-white.bg-secondary
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card.text-white.bg-success
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card.text-white.bg-danger
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card.text-white.bg-warning
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card.text-white.bg-info
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card.bg-light
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card.text-white.bg-dark
Some quick example text to build on the card title and make up the bulk of the card's content.
ボーダーユーティリティ を用いる(⇒ ボーダー色 )。
div.card.border-primary
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card.border-secondary
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card.border-success
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card.border-danger
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card.border-warning
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card.border-info
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card.border-light
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card.border-dark
Some quick example text to build on the card title and make up the bulk of the card's content.
ヘッダ/フッタなどの各構成要素には親要素と別のテキスト/背景/ボーダー設定が可能。さらに .bg-transparent で背景なしにすることも可能。設定例を次に示す。
div.card.border-success 外枠はsuccess配色
div.card-header にバリエーション設定(デフォルト+全context+transparent)p.card-body.text-success
div.card-footer にバリエーション設定(デフォルト+全context+transparent)(デフォルト背景)
Some quick example text to build on the card title and make up the bulk of the card's content.
.bg-primary
Some quick example text to build on the card title and make up the bulk of the card's content.
.bg-secondary
Some quick example text to build on the card title and make up the bulk of the card's content.
.bg-success
Some quick example text to build on the card title and make up the bulk of the card's content.
.bg-danger
Some quick example text to build on the card title and make up the bulk of the card's content.
.bg-warning
Some quick example text to build on the card title and make up the bulk of the card's content.
.bg-info
Some quick example text to build on the card title and make up the bulk of the card's content.
.bg-light
Some quick example text to build on the card title and make up the bulk of the card's content.
.bg-dark
Some quick example text to build on the card title and make up the bulk of the card's content.
.bg-transparent
Some quick example text to build on the card title and make up the bulk of the card's content.
div.card-(group|deck|columns)
div.carddiv.card-group
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
This card has supporting text below as a natural lead-in to additional content.
This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.
div.card-deck
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
This card has supporting text below as a natural lead-in to additional content.
This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.
div.card-columns (応用) 3段組みレイアウト
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.
(2) Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
This card has supporting text below as a natural lead-in to additional content.
Last updated 3 mins ago
(4) Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
This card has supporting text below as a natural lead-in to additional content.
Last updated 3 mins ago
(6) Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.
This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.
Last updated 3 mins ago