Display models
Mw-rid has 3 display models: "block", "inline-block" and "flexbox".
And they are CSS-classes for row wrap: ".row", ".row-line" and ".row-flex"
- 3 models flexbox, block and inline-block
- Set models in SCSS options (
$display_models) - Drive models with 3 CSS-classes is deadly simple
Display models is set in SCSS obj $display_models
| Block | Inline-Block | Flex | |
|---|---|---|---|
| Display | block |
inline-block |
flex |
| CSS-class | ".row" |
".row-line" |
".row-flex" |
| Reverse | ✔ | ✔ | ✔ |
| Horizontal aligment | ✔ | ✔ | ✔ |
| Vertical aligment | ✔ | ✔ | |
| Columns Same Height | ✔ | ||
| Specific order | ✔ |
Block model
Block model is simple and solid oldschool recepsion for make modular grid layout
- Columns in block row display like blocks
float: left; - Columns order can be reverse (
."row-reverse")
Columns can be nested. Always it's need ".row" wrapper
"row row-reverse"
column 1
column 2
<div class="demo-block">"row row-reverse"
<div class="row row-reverse">
<div class="mv_12">
<div class="demo-block">column 1
</div>
</div>
<div class="mv_12">
<div class="demo-block">column 2
</div>
</div>
</div>
</div>
Inline-block model
Inline-Block is more powerfull than block and more cross-browser than flex. It has vertical aligment columns in row
- Columns in inline-block row display like inline-blocks
display: inline-blocks; - Columns order can be reverse (
."row-reverse") - Columns can be aligned vertically (
."middle"and other) - Row has nulled font-size (
font-size: 0)
"row-line middle"
column 1
we need set font-size to element in a row-line
we need set font-size to element in a row-line
column 2
<div class="demo-block">"row-line middle"
<div class="row-line middle">
<div class="mv_12">
<div class="demo-block" style="font-size: 1rem">column 1<br>we need set font-size to element in a row-line
</div>
</div>
<div class="mv_12">
<div class="demo-block" style="font-size: 1rem">column 2
</div>
</div>
</div>
</div>
Flex model
Flex is most powerfull way to arrange columns inside rows. It has columns same height and specific columns order.
- Columns in flex row display like elements in flex container
display: flex - Columns order can be reverse (
."row-reverse") - Columns can be aligned vertically (
."middle"and other) - Columns can be the same height (
."stretch")
"row-flex stretch"
column 1
columns can be
the same height
columns can be
the same height
column 2
<div class="demo-block">"row-flex stretch"
<div class="row-flex stretch">
<div class="mv_12">
<div class="demo-block">column 1<br>columns can be <br>the same height
</div>
</div>
<div class="mv_12">
<div class="demo-block">column 2
</div>
</div>
</div>
</div>
