flowにcolumn
Flexbox and float
float:left; はflex /float: right; とoverflow: hidden;
@media (max-width: 800px){} 800pxの後ろに";"は要らない。
CSS Display propertyflex-basis: The length of the item. the number followed by "%", "px", or "em".
flex: 50%;
Responsive navigation bar and CSS column property
column-count: 3 to 2(@media screen and(max-width:800px))
CSS multiple columnsfloat with multiple columns
multiple column 1
4 columns layout 900px wider backgound-color: lightgrey;, the colmns will 2 columns when the screen width 900px wide or less backbround-color: lightblue;. When 600px wide or less, the colulmns width 100% background-color: hsla(16, 100%, 66%, 0.7).
multiple column 2
4 columns layout 900px wider backgound-color: lightgrey;, the colmns will 2 columns when the screen width 900px wide or less backbround-color: lightblue;. When 600px wide or less, the colulmns width 100% background-color: hsla(16, 100%, 66%, 0.7).
multiple column 3
4 columns layout 900px wider backgound-color: lightgrey;, the colmns will 2 columns when the screen width 900px wide or less backbround-color: lightblue;. When 600px wide or less, the colulmns width 100% background-color: hsla(16, 100%, 66%, 0.7).
multiple column 4
4 columns layout 900px wider backgound-color: lightgrey;, the colmns will 2 columns when the screen width 900px wide or less backbround-color: lightblue;. When 600px wide or less, the colulmns width 100% background-color: hsla(16, 100%, 66%, 0.7).
.row-m::after { content: ""; display: table; clear: both; } .column-float { float: left; width: 25%; padding: 15px; background-color: lightgrey; } @media screen and (max-width:900px) { .column-float { width: 50%; background-color: lightblue; } } @media screen and (max-width: 600px) { .column-float { width: 100%; background-color: hsla(16, 100%, 66%, 0.7); } }
use display: flex; and flex: 25%/50%/100%
flex-direction: column;
column with flex
4 columns flex: 25%; . 2 columns flex: 50%; . 1 column flex:100%; , or container<div> flex-direction: column; .
column with flex
4 columns flex: 25%; . 2 columns flex: 50%; . 1 column flex-direction: column; .
column with flex
4 columns flex: 25%; . 2 columns flex: 50%; . 1 column flex-direction: column; .
column with flex
4 columns flex: 25%; . 2 columns flex: 50%; . 1 column flex-direction: column; .
.row-flex { display: flex; flex-wrap: wrap; } .column-flex { flex: 25%; padding: 15px; background-color: lightgrey; } @media screen and (max-width: 900px) { .column-flex { flex: 50%; background-color: lightblue; } } @media screen and (max-width: 600px) { .column-flex { /*flex: 100%;*/ background-color: hsla(16, 100%, 66%, 0.7); } } @media screen and (max-width: 600px) { .row-flex { flex-direction: column; } }
コメント
コメントを投稿