min-height and width with flex

The child element of a flexbox may not obey to the css property min-height. Therefore you should use this code in the parent element: min-height: 100vh.

Otherwise the child element, f.e. the main div of a web page with few content, could end before the end of the page, in an inelegant way.

The width of a child element as well may not work as expected (and as it would do without flex). Therefore you should explicitly state the width of a child element within a flexbox.

Otherwise a web page (with few text, i.g.) could have a width considerably narrower that expected.

Lascia un commento

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *