First Public Working Draft · css-page-floats

CSS Page Floats

5 properties, 2 functions defined by this specification, 2 of them known to at least one browser (the others are badged Not in any browser yet).

Each feature in detail

clear

Property Baseline: widely availablesince January 2018

MDN The clear CSS property sets whether an element must be moved below (cleared) floating elements that precede it. The clear property applies to floating and non-floating elements.

Live preview Example from MDN
.example-container {
  border: 1px solid #c5c5c5;
  padding: 0.75em;
  text-align: left;
  line-height: normal;
}

.floated-left {
  border: solid 10px #ffc129;
  background-color: rgb(81 81 81 / 0.6);
  padding: 1em;
  float: left;
}

.floated-right {
  border: solid 10px #ffc129;
  background-color: rgb(81 81 81 / 0.6);
  padding: 1em;
  float: right;
  height: 150px;
}

Syntax

inline-start | inline-end | block-start | block-end | left | right | top | bottom | both-inline | both-block | both | none

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
block-level elements, floats, regions, pages
Inherited
no
Percentages
N/A
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting clear
Chrome 1
Edge 12
Firefox 1
Safari 1
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

float

Property Baseline: widely availablesince January 2018

MDN The float CSS property places an element on the left or right side of its container, allowing text and inline elements to wrap around it. The element is removed from the normal flow of the page, though still remaining a part of the flow (in contrast to absolute positioning).

Live preview Example from MDN
.example-container {
  border: 1px solid #c5c5c5;
  padding: 0.75em;
  text-align: left;
  width: 80%;
  line-height: normal;
}

#example-element {
  border: solid 10px #efac09;
  background-color: #040d46;
  color: white;
  padding: 1em;
  width: 40%;
}

Syntax

block-start | block-end | inline-start | inline-end | snap-block | <snap-block()> | snap-inline | <snap-inline()> | left | right | top | bottom | none | footnote

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
all elements.
Inherited
no
Percentages
N/A
Computed value
as specified
Canonical order
per grammar
Animation type
by computed value type

Browser support

First browser version supporting float
Chrome 1
Edge 12
Firefox 1
Safari 1
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

float-defer

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

<integer> | last | none

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
floats
Inherited
no
Percentages
N/A
Computed value
specified keyword or integer
Canonical order
per grammar
Animation type
discrete

float-offset

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

<length-percentage>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
0
Applies to
floats
Inherited
no
Percentages
see prose
Computed value
computed <length-percentage> value
Canonical order
per grammar
Animation type
by computed value type

float-reference

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

inline | column | region | page

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
inline
Applies to
all elements.
Inherited
no
Percentages
N/A
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete

snap-block()

Function Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

/* for float */
snap-block( <length> , [ start | end | near ]? )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Defined for

float

This feature only appears in the context of these properties, functions or types.

snap-inline()

Function Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

/* for float */
snap-inline( <length> , [ left | right | near ]? )

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Defined for

float

This feature only appears in the context of these properties, functions or types.