Does centering with flexbox remove the effect of block divs?

Whenever I horizontally center a div inside a flexbox, the div just seems to lose the effect of being a block element. It doesn't take the entire line width anymore. Is that just how flexbox works?
3 Replies
Kevin Powell
Kevin Powell11mo ago
when you use display: flex, the children of that element are no long block elements, they're now flex items Part of that is the width is calculated in a very different way
snxxwyy
snxxwyy11mo ago
If you want a flex item to take the entire width, use the flex-basis property
b1mind
b1mind11mo ago
Or use grid #depends it's default for children is to fill.

Did you find this page helpful?