flex-wrap
bootstrap5.css
bootstrap5.css
.row {
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
margin-right: -15px;
margin-left: -15px;
}
bootstrap5.css
.form-row {
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
margin-right: -5px;
margin-left: -5px;
}
bootstrap5.css
.btn-toolbar {
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-ms-flex-pack: start;
justify-content: flex-start;
}
bootstrap5.css
.input-group {
position: relative;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-ms-flex-align: stretch;
align-items: stretch;
width: 100%;
}
bootstrap5.css
.nav {
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
padding-left: 0;
margin-bottom: 0;
list-style: none;
}
bootstrap5.css
.navbar {
position: relative;
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: justify;
justify-content: space-between;
padding: 0.5rem 1rem;
}
bootstrap5.css
.navbar > .container,
.navbar > .container-fluid {
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-ms-flex-align: center;
align-items: center;
-ms-flex-pack: justify;
justify-content: space-between;
}
bootstrap5.css
@media (min-width: 576px) {
.navbar-expand-sm {
-ms-flex-flow: row nowrap;
flex-flow: row nowrap;
-ms-flex-pack: start;
justify-content: flex-start;
}
.navbar-expand-sm .navbar-nav {
-ms-flex-direction: row;
flex-direction: row;
}
.navbar-expand-sm .navbar-nav .dropdown-menu {
position: absolute;
}
.navbar-expand-sm .navbar-nav .nav-link {
padding-right: 0.5rem;
padding-left: 0.5rem;
}
.navbar-expand-sm > .container,
.navbar-expand-sm > .container-fluid {
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
}
.navbar-expand-sm .navbar-collapse {
display: -ms-flexbox !important;
display: flex !important;
-ms-flex-preferred-size: auto;
flex-basis: auto;
}
.navbar-expand-sm .navbar-toggler {
display: none;
}
}
bootstrap5.css
@media (min-width: 768px) {
.navbar-expand-md {
-ms-flex-flow: row nowrap;
flex-flow: row nowrap;
-ms-flex-pack: start;
justify-content: flex-start;
}
.navbar-expand-md .navbar-nav {
-ms-flex-direction: row;
flex-direction: row;
}
.navbar-expand-md .navbar-nav .dropdown-menu {
position: absolute;
}
.navbar-expand-md .navbar-nav .nav-link {
padding-right: 0.5rem;
padding-left: 0.5rem;
}
.navbar-expand-md > .container,
.navbar-expand-md > .container-fluid {
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
}
.navbar-expand-md .navbar-collapse {
display: -ms-flexbox !important;
display: flex !important;
-ms-flex-preferred-size: auto;
flex-basis: auto;
}
.navbar-expand-md .navbar-toggler {
display: none;
}
}
bootstrap5.css
@media (min-width: 992px) {
.navbar-expand-lg {
-ms-flex-flow: row nowrap;
flex-flow: row nowrap;
-ms-flex-pack: start;
justify-content: flex-start;
}
.navbar-expand-lg .navbar-nav {
-ms-flex-direction: row;
flex-direction: row;
}
.navbar-expand-lg .navbar-nav .dropdown-menu {
position: absolute;
}
.navbar-expand-lg .navbar-nav .nav-link {
padding-right: 0.5rem;
padding-left: 0.5rem;
}
.navbar-expand-lg > .container,
.navbar-expand-lg > .container-fluid {
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
}
.navbar-expand-lg .navbar-collapse {
display: -ms-flexbox !important;
display: flex !important;
-ms-flex-preferred-size: auto;
flex-basis: auto;
}
.navbar-expand-lg .navbar-toggler {
display: none;
}
}
bootstrap5.css
@media (min-width: 1200px) {
.navbar-expand-xl {
-ms-flex-flow: row nowrap;
flex-flow: row nowrap;
-ms-flex-pack: start;
justify-content: flex-start;
}
.navbar-expand-xl .navbar-nav {
-ms-flex-direction: row;
flex-direction: row;
}
.navbar-expand-xl .navbar-nav .dropdown-menu {
position: absolute;
}
.navbar-expand-xl .navbar-nav .nav-link {
padding-right: 0.5rem;
padding-left: 0.5rem;
}
.navbar-expand-xl > .container,
.navbar-expand-xl > .container-fluid {
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
}
.navbar-expand-xl .navbar-collapse {
display: -ms-flexbox !important;
display: flex !important;
-ms-flex-preferred-size: auto;
flex-basis: auto;
}
.navbar-expand-xl .navbar-toggler {
display: none;
}
}
bootstrap5.css
.navbar-expand > .container,
.navbar-expand > .container-fluid {
-ms-flex-wrap: nowrap;
flex-wrap: nowrap;
}
bootstrap5.css
.breadcrumb {
/* パン屑 */
display: -ms-flexbox;
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
padding: 0.75rem 1rem;
margin-bottom: 1rem;
list-style: none;
background-color: #e9ecef;
border-radius: 0.25rem;
}
bootstrap5.css
.flex-wrap {
-ms-flex-wrap: wrap !important;
flex-wrap: wrap !important;
}
bootstrap5.css
.flex-nowrap {
-ms-flex-wrap: nowrap !important;
flex-wrap: nowrap !important;
}
bootstrap5.css
.flex-wrap-reverse {
-ms-flex-wrap: wrap-reverse !important;
flex-wrap: wrap-reverse !important;
}
html bootstrap5 Sample
flexのいい感じで自動で折り返す:flex-wrap
flex文字01
flex文字02
flex文字03
flex文字04
flex文字05
flex文字06
flex文字07
flex文字08
flex文字09
flex文字10
flex文字11
flex文字12
flex文字13
flex文字14
flex文字15
flex文字16
flex文字17
flex文字18
flex文字19
flex文字20
<!-- 羅列すれば、勝手に自動で折り返してくれる(制御する必要なし) -->
<!-- 文字数より大きさも自動で決まる) -->
<!-- rowとcolとの違いは、ひたすら列挙して、改行や幅や位置などを自動整列していくれるところ -->
<div class="d-flex flex-wrap">
<div>flex文字01</div>
<div>flex文字02</div>
<div>flex文字03</div>
<div>flex文字04</div>
<div>flex文字05</div>
<div>flex文字06</div>
<div>flex文字07</div>
<div>flex文字08</div>
<div>flex文字09</div>
<div>flex文字10</div>
<div>flex文字11</div>
<div>flex文字12</div>
<div>flex文字13</div>
<div>flex文字14</div>
<div>flex文字15</div>
<div>flex文字16</div>
<div>flex文字17</div>
<div>flex文字18</div>
<div>flex文字19</div>
<div>flex文字20</div>
</div>
flex縦の均等配置/トップからスタートする:align-content-start
flex文字01
flex文字02
flex文字03
flex文字04
flex文字05
flex文字06
flex文字07
flex文字08
flex文字09
flex文字10
flex文字11
flex文字12
<div class="d-flex align-content-start flex-wrap" style="height: 200px">
<!-- 文字列01が上段の左端からスタートする -->
<div>flex文字01</div>
<div>flex文字02</div>
<div>flex文字03</div>
<div>flex文字04</div>
<div>flex文字05</div>
<div>flex文字06</div>
<div>flex文字07</div>
<div>flex文字08</div>
<div>flex文字09</div>
<div>flex文字10</div>
<div>flex文字11</div>
<div>flex文字12</div>
</div>
flex縦の均等配置/順序を反転させて下段からスタートする:flex-wrap-reverse
flex文字01
flex文字02
flex文字03
flex文字04
flex文字05
flex文字06
flex文字07
flex文字08
flex文字09
flex文字10
flex文字11
flex文字12
<div class="d-flex flex-wrap-reverse">
<!-- 文字列01が下段からスタートする、最新情報を上に出す場合など -->
<div>flex文字01</div>
<div>flex文字02</div>
<div>flex文字03</div>
<div>flex文字04</div>
<div>flex文字05</div>
<div>flex文字06</div>
<div>flex文字07</div>
<div>flex文字08</div>
<div>flex文字09</div>
<div>flex文字10</div>
<div>flex文字11</div>
<div>flex文字12</div>
</div>
flex縦の均等配置/高さ固定で、中央寄せ:align-content-center
flex文字01
flex文字02
flex文字03
flex文字04
flex文字05
flex文字06
flex文字07
flex文字08
flex文字09
flex文字10
flex文字11
flex文字12
<div class="d-flex align-content-center flex-wrap" style="height: 200px">
<!-- height固定で、中央寄せ -->
<div>flex文字01</div>
<div>flex文字02</div>
<div>flex文字03</div>
<div>flex文字04</div>
<div>flex文字05</div>
<div>flex文字06</div>
<div>flex文字07</div>
<div>flex文字08</div>
<div>flex文字09</div>
<div>flex文字10</div>
<div>flex文字11</div>
<div>flex文字12</div>
</div>
flex縦の均等配置/高さ固定で、ボトム詰め:align-content-end
flex文字01
flex文字02
flex文字03
flex文字04
flex文字05
flex文字06
flex文字07
flex文字08
flex文字09
flex文字10
flex文字11
flex文字12
<div class="d-flex align-content-end flex-wrap" style="height: 200px">
<div>flex文字01</div>
<div>flex文字02</div>
<div>flex文字03</div>
<div>flex文字04</div>
<div>flex文字05</div>
<div>flex文字06</div>
<div>flex文字07</div>
<div>flex文字08</div>
<div>flex文字09</div>
<div>flex文字10</div>
<div>flex文字11</div>
<div>flex文字12</div>
</div>
flex縦の均等配置/高さ固定で、上と下:align-content-between
flex文字01
flex文字02
flex文字03
flex文字04
flex文字05
flex文字06
flex文字07
flex文字08
flex文字09
flex文字10
<div class="d-flex align-content-between flex-wrap" style="height: 200px">
<!-- height固定で、上と下 -->
<div>flex文字01</div>
<div>flex文字02</div>
<div>flex文字03</div>
<div>flex文字04</div>
<div>flex文字05</div>
<div>flex文字06</div>
<div>flex文字07</div>
<div>flex文字08</div>
<div>flex文字09</div>
<div>flex文字10</div>
</div>
flex縦の均等配置/高さ固定で、行間自動調整:align-content-around
flex文字01
flex文字02
flex文字03
flex文字04
flex文字05
flex文字06
flex文字07
flex文字08
flex文字09
flex文字10
<div class="d-flex align-content-around flex-wrap" style="height: 200px">
<!-- height固定で、行間自動調整 -->
<div>flex文字01</div>
<div>flex文字02</div>
<div>flex文字03</div>
<div>flex文字04</div>
<div>flex文字05</div>
<div>flex文字06</div>
<div>flex文字07</div>
<div>flex文字08</div>
<div>flex文字09</div>
<div>flex文字10</div>
</div>
flex縦の均等配置/縦の高さも勝手に合わせてくる:align-content-stretch
flex文字01
flex文字02
flex文字03
flex文字04
flex文字05
flex文字06
flex文字07
flex文字08
flex文字09
flex文字10
flex文字11
flex文字12
<div class="d-flex align-content-stretch flex-wrap" style="height: 400px">
<!-- height固定のサイズで、flaxの高さも自動で調整する -->
<div>flex文字01</div>
<div>flex文字02</div>
<div>flex文字03</div>
<div>flex文字04</div>
<div>flex文字05</div>
<div>flex文字06</div>
<div>flex文字07</div>
<div>flex文字08</div>
<div>flex文字09</div>
<div>flex文字10</div>
<div>flex文字11</div>
<div>flex文字12</div>
</div>