4

When calculating width and height of the box, outline width like

outline: 5px dashed red;

if box-sizing:border-box, is outline will be considered in the width/height of the box ?

2 Answers2

4

I found a note about it on W3Schools HERE

It says: "Outline differs from borders! Unlike border, the outline is drawn outside the element's border, and may overlap other content. Also, the outline is NOT a part of the element's dimensions; the element's total width and height is not affected by the width of the outline."

When you set an outline it should NOT be affected by box-sizing setting and outline will be outside of the box.

Jakub Muda
  • 6,008
  • 10
  • 37
  • 56
1

Outline property is independent of box-sizing and is not as part of width or height of the element. I generally used to stand out the element from the crowd.

Pons Purushothaman
  • 2,225
  • 1
  • 14
  • 23