CSS Box Model Specification

W3C Working Draft,

More details about this document
This version:
https://www.w3.org/TR/2023/w3c/WD-css-box-model-1-20230605/
Latest published version:
https://www.w3.org/TR/css-box-model
Editor's Draft:
https://example.com/css-box-model
History:
https://www.w3.org/standards/history/css-box-model-1
Feedback:
GitHub
Editor:
John Doe <john.doe@example.com>

Abstract

This specification defines the box model used in CSS, which describes the layout and rendering of elements on a web page.

Status of this document

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:

1.2. Box Model Properties

The following properties control the box model:

1.2.1. width

1.2.2. height

1.2.3. padding

1.2.4. border

1.2.5. margin

Conformance

Document conventions

Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification.

All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. [RFC2119]

Examples in this specification are introduced with the words “for example” or are set apart from the normative text with class="example", like this:

This is an example of an informative example.

Informative notes begin with the word “Note” and are set apart from the normative text with class="note", like this:

Note, this is an informative note.

Conformant Algorithms

Requirements phrased in the imperative as part of algorithms (such as "strip any leading space characters" or "return false and abort these steps") are to be interpreted with the meaning of the key word ("must", "should", "may", etc) used in introducing the algorithm.

Conformance requirements phrased as algorithms or specific steps can be implemented in any manner, so long as the end result is equivalent. In particular, the algorithms defined in this specification are intended to be easy to understand and are not intended to be performant. Implementers are encouraged to optimize.

References

Normative References

[RFC2119]
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119