mx-auto
bootstrap5.css
bootstrap5.css
.mx-auto {
margin-right: auto !important;
margin-left: auto !important;
}
html bootstrap5 Sample
フロートを解除する(親要素範囲内でfloatを使う):clearfix
フロートを解除なし(重なっているので背景色がでない)
右フロート
<div class="w-50 mx-auto bg-danger">
<div class="float-end bg-success">右フロート</div>
</div>
テキストが折り返さないように設定する:text-nowrap
途中で折り返しなしはtext-nowrapを追加 | 途中で折り返しても良い場合は何もなし |
---|
<table class="w-50 mx-auto">
<tr>
<th class="text-nowrap">途中で折り返しなしはtext-nowrapを追加</th>
<td>途中で折り返しても良い場合は何もなし</td>
</tr>
</table>