CSS Specification Example
1. Introduction
This specification defines the box model used in CSS, which describes the layout and rendering of elements on a web page.1.1. Box Model Overview
The box model consists of the following components:
-
Content box: The inner area where the element’s content is displayed.
-
Padding: The space between the content box and the element’s border.
-
Border: The line that surrounds the content and padding.
-
Margin: The space between the element and its neighboring elements.
1.2. Box Model Properties
The following properties control the box model:
1.2.1. width
-
Value: `[length] | [percentage] | auto`
-
Default: `auto`
-
Description: Sets the width of the element’s content box.
1.2.2. height
-
Value: `[length] | [percentage] | auto`
-
Default: `auto`
-
Description: Sets the height of the element’s content box.
1.2.3. padding
-
Value: `[length] | [percentage]`
-
Default: `0`
-
Description: Sets the padding space around the element’s content box.
1.2.4. border
-
Value: `[border-width] | [border-style] | [color]`
-
Default: `none`
-
Description: Sets the border of the element.
1.2.5. margin
-
Value: `[length] | [percentage]`
-
Default: `0`
-
Description: Sets the margin space around the element.