@haquanq
Posted
Hello @suzzy-dszy,
Are you using browser Devtool for development?
To answer your feedback question above:
body
ormain
(other than textual elements or a few other elements likeinput, img, ..
) is block level element (has default ofdisplay: block
) which has it's width always expanded to fit the parent element and it's height to fit it's content size by default.- Using
display: flex
on parent element make it's child element's width to shrink to it's content size. In your case, you are usingdisplay: flex
onbody
which makemain
element size shrunken to it's content (consists of element sizes, paddings, margins).
<body>
<main>
<main>
</body>
body {
display: flex; /* this override main element default width - not expand anymore*/
}
Have a nice day!
Marked as helpful