How does width work for floating elements?

Hi everyone,

I’m studying the curriculum and found myself with an issue.

Why is it that if i set the width property to 50% for two floating elements (one in the left and one in the right) they don’t appear next to each other?

it is because you gave padding:2px; to section element. remove padding from section element will work fine.

It’s because of box-sizing

Usually this is the first thing I add to my CSS:

* {
  box-sizing: border-box;
}