3 ms·
This div { width:100px; height:100px; margin:1fx; // all margins, horizontal and vertical } will place div in the middle/center of its
by c-smile 4y ago
This
div {
width:100px;
height:100px;
margin:1fx; // all margins, horizontal and vertical
}
will place div in the middle/center of its container.
a) is significantly easier to understand b) is more flexible than bunch of flexbox props and c) does not break CSS box model and d) has clear physical model, see : https://terrainformatica.com/2018/12/11/10-years-of-flexboxing/ https://terrainformatica.com/2018/12/11/10-years-of-flexboxi...
Just try to define same thing using flexbox...