Should I use box-sizing when I use Flexbox and Grid?

Hi all,
I didn’t learn Flexbox and Grid yet, but I have a question.

Should I use box-sizing when I use Flexbox and Grid?

html {
  box-sizing: border-box;
}
*, *:before, *:after {
  box-sizing: inherit;
}

Is there any point to do that? Or flexbox/grid do this automatically?

I use border-box for pretty much everything.

1 Like

To answer this:

a) Css flex and grid does not apply this automatically

b) You don’t have to use it, but it is very useful as it will save the headache of not having to do calculation on measurement elements. If you are not particular sure what this property meant to do, let me know I will be happy to explain :slight_smile:

1 Like

I know what it does, I just didn’t know how it works with flexbox and grid, but now I got the idea :slight_smile: Thanks for the help!

1 Like

That is great to hear and you are welcome :slight_smile: If anything, when you get to learn CSS flex and grid, you will love box-sizing even more :wink:

Have a good day!

1 Like