border
The line drawn around an element's padding, with its own width, style and colour.
In more detail
Border width counts toward an element's size under content-box sizing. Changing a border's colour only needs a repaint, but changing its width needs layout.
Related terms
- CSS box model — The rule that every element is drawn as a rectangle made of four layers: content, then padding, then border, then margin.
- padding — The space inside an element between its content and its border, filled with the element's background.
- margin — Transparent space outside an element's border that pushes neighbouring elements away.
Taught in
- Modern Box Model, Box Sizing, Display Types And Flow Layout — Frontend Architecture & Web Platform
- Layout, Reflow, Paint And GPU Compositing Layers — Frontend Architecture & Web Platform