Question
Is the border thickness added to the box height and width?
Answer
It is important to realize that there is a distinction between the rendered height and width of an element and the width
and height
properties of an element. By default, the width
and height
properties only affect the content area of a box. This means that while the border
, padding
, and margin
properties do affect the rendered dimensions of an element they do not factor into the width and height of a box’s content area as specified by the width
and height
properties.
As you will learn in the next lesson, this default behavior can be modified with the box-sizing: border-box;
declaration.