CSS Page Floats

Editor’s Draft,

This version:
http://dev.w3.org/csswg/css-page-floats/
Previous Versions:
https://hg.csswg.org/drafts/raw-file/108d7e3ff204/css-page-floats/Overview.html
Feedback:
www-style@w3.org with subject line “[css-page-floats] … message topic …” (archives)
Issue Tracking:
Inline In Spec
Editor:
(Vivliostyle)
Former Editor:
(Opera Software)

Abstract

This document describes floats that move to the top or bottom of content passages. This feature has traditionally been used in print publications in which figures and photos are moved to the top or bottom of columns or pages, along with their captions. This draft describes how to achieve this effects for floats within pages, columns, regions and elements.

CSS is a language for describing the rendering of structured documents (such as HTML and XML) on screen, on paper, in speech, etc.

Status of this document

This is a public copy of the editors’ draft. It is provided for discussion only and may change at any moment. Its publication here does not imply endorsement of its contents by W3C. Don’t cite this document other than as work in progress.

The (archived) public mailing list www-style@w3.org (see instructions) is preferred for discussion of this specification. When sending e-mail, please put the text “css-page-floats” in the subject, preferably like this: “[css-page-floats] …summary of comment…

This document was produced by the CSS Working Group (part of the Style Activity).

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

This document is governed by the 1 August 2014 W3C Process Document.

Table of Contents

1. Overview

This section is not normative.

This specification adds new keywords on the float property.

This document allows to specify whether a float floats to align with a float reference inline box, column, region or page. In the case of floats with a reference column, region or page, placement can be deferred to a subsequent column, region or page with the float-defer properties.

Floats with a column reference can be set to span several columns, thereby supporting commonly used newspaper layouts. New values on the clear property add further ways of refining layouts.

The way contents wrap around floats can be controlled by changing the value of the wrap-flow property which initially is set to both for floats.

Floats as defined here work with different types of fragmentation types (columns, regions, pages) as well as container elements. The specification is no longer specific to print or to pages. At the same time, inline floats and page floats differ in many ways, and it may (or may not) be a good idea to separate the two entirely. Therefore, the name CSS Page Floats should probably be replaced with a more appropriate name.

2. Terminology

Float
An element which has float set to something else than none.
Float block formatting context
The block formatting context which is generated by a float and which contains its contents.
Float anchor
The float anchor is the point in the flow where the float had appeared had it not been a float and instead had been an empty inline element with no margins, borders or padding.
Float containing block formatting context
The block formatting context inside of which the float is embedded.
Initial float reference
The entity to which the float is aligned initially, before automatic float deference takes place.
Float reference
The entity to which the float is aligned.

3. Floating to the inline-start/inline-end and block-start/block-end

Floating elements can float to the start or end of the float anchor’s line or block, specified by the float attribute. The floats are aligning to the start or end of a float reference, specified by the float-reference attribute. The float reference can be the float anchor’s line box, column, region or page.

3.1. The float-reference property

Name: float-reference
Value: inline | column | region | page
Initial: inline
Applies to: all elements.
Inherited: no
Percentages: N/A
Media: visual
Computed value: as specified.
Animatable: no
inline
The float reference is the line box of the float anchor.

The float containing block formatting context is the same as that of the float anchor.

column
The float reference is the column in a multi column environment in which the float anchor is placed. If the float anchor is not inside a column, the float reference is the line box of the float anchor.

The float containing block formatting context is a new block formatting context with the same dimensions and placement as the float reference.

region
The float reference is the region in a region-chain within which the float anchor is placed. If the float anchor is not inside a region, the float reference is the line box of the float anchor.

The float containing block formatting context is a new block formatting context with the same dimensions and placement as the float reference.

page
The float reference of the float is the page within which the float anchor is placed. If the float anchor is not inside a page, the float reference is the line box of the float anchor.

The float containing block formatting context is a new block formatting context with the same dimensions and placement as the float reference

The float containing block formatting context having the same dimensions as the float reference means that all floats that are not inline floats cannot move outside of their float references. Is this wanted?
It is not possible to directly specify which element to use as the reference element. This may be of interest to have.

Maybe something like:

<style>
.float {
float-reference: float-container;
}

#container {
float-container: true;
}
</style>

<div id="container">
<p>First paragraph<span class="float">FLOAT</span></p>

<p>Second paragraph
<span class="inline-block">[<span class="float">FLOAT</span>] </span>
And some more text</p>
</div>
    

This should float both floats with reference to the <div id="container"> element, rather than the <P> and inline <SPAN> elements.

3.2. The float property

Name: float
Value: block-start | block-end | inline-start | inline-end | snap-block | snap-inline | left | right | top | bottom | none
Initial: none
Applies to: all elements.
Inherited: no
Percentages: N/A
Media: visual
Computed value: as specified.
Animatable: no
inline-start
The element generates a box that is floated to the line-start outer edge of the float reference. Content flows on the line-end side of the box (subject to the ‘clear’ property).
inline-end
The element generates a box that is floated to the line-end outer edge of the float reference. Content flows on the line-start side of the box (subject to the ‘clear’ property).
block-start
If the float reference is a line box, block-start behaves like inline-start.

If the float reference is not a line box, the element generates a box that is floated to the block-start and line-start outer edges of the float reference.

The initial value of the max-width or max-height property that refers to the inline size of the float is '100%'.

Content flows on the block-end side of the box (subject to the ‘clear’ property).

block-end
If the float reference is a line box, block-end behaves like inline-end.

If the float reference is not a line box, the element generates a box that is floated to the block-end and line-start outer edges of the float reference.

The initial value of the max-width or max-height property that refers to the inline size of the float is '100%'.

Content flows on the block-start side of the box (subject to the ‘clear’ property).

Should block-end and block-start floats be allowed to have an inline-size that is larger than the that of the float reference? What should happen in that case?
left
If the float reference is a line box, behaves like inline-start or inline-end, whichever corresponds to line-left for the float reference.

Otherwise, behaves like block-end, inline-start or inline-end depending on the float containing block’s direction and writing-mode.

right
If the float reference is a line box, behaves like inline-start or inline-end, whichever corresponds to line-right for the float reference.

Otherwise, behaves like block-start, inline-start or inline-end depending on the float containing block’s direction and writing-mode.

top
Behave like block-start or inline-start depending on the float containing block’s direction and writing-mode.
bottom
Behave like block-end or inline-end depending on the float containing block’s direction and writing-mode.
snap-block(<length> <length>? [, start | end | near ]?)
Makes the element float to the start or the end of the block if it naturally appears within a certain distance from either one. The length value(s) specifies the maximum distance from the start/end that an element must be within in order to be floated; one length value specifies the distance from both the start and the end, two length values specify the distance from the start and end, respectively.

The optional keyword value specifies where the element is floated: start, end, or the nearest of the two. The initial value is near. If near is in effect and the element is within the specified distance both from the start and the end, end wins.

An element is considered to be a float if it has a snap-block() value, even if the element does not appear within the specified distance. This way, it can be determined whether an element is float or not without laying out the document.

snap-block
same as snap-block(2em, near)
snap-inline(<length> <length>? [, left | right | near ]?)
Makes the element float to the line start or line end if it naturally appears within a certain distance from the start or end of the line. The length value(s) specifies the maximum distance from the start/end that an element must be within in order to be floated; one length value specifies the distance from both the start and the end, two length values specify the distance from the start and end, respectively.

The optional keyword value specifies where the element is floated: line start, line end, or the nearest of the two. The initial value is near. If near is in effect and the element is within the specified distance both from the start and the end, end wins.

An element is considered to be a float if it has a snap-inline() value, even if the element does not appear within the specified distance. This way, it can be determined whether an element is float or not without laying out the document.

snap-inline
same as snap-inline(2em, near)
none
The box is not floated.
There is currently no way to float into a combination of directions (top right, right top, left bottom, bottom left, etc.).
Float figure to top of reference column:
.figure { float-reference: column; float: top }

sample rendering

In this example a block-start float that does not fill the entire inline size of the float reference is placed at the start of the block and line.
.figure { float-reference: column; float: block-start; width: 50% }

sample rendering

In this example, a figure naturally appears close to a column break. There is not enough space for the figure in the first column, and it is therefore placed in the second column, leaving white space at the bottom of the first column.

sample rendering

To avoid the white space, the image can be floated to the nearest edge (in the block direction):

.figure { float-reference: column; float: snap-block }

In this example, the figure is already at the nearest edge, so it does not move. However, floats allow subsequent content to be displayed before the float and the white space can therefore be filled:

sample rendering

In this example, two figures naturally appear in the text flow:

sample rendering

A typographer would typically try to avoid single lines of text above/below figures, which can be achieved with:

div.figure { float-reference: column; float: snap-block(1.5em) }

The length value specifies the reach of the snap function; in this example the second figure is affected, but not the first.

In this example, two figures naturally appear in the text flow:

sample rendering

To make the figures snap to the nearest edges, this code can be applied:

div.figure { float-reference: column; float: snap-block(2.5em) }

The resultant rendering is:

sample rendering

In this example, tables will snap to the top/bottom if the top/bottom of the border box is closer than 3em from the top/bottom of the float-reference which is a block element.
table { float: snap }
table { float: snap-block(3em) }
table { float: snap-block(3em, bottom) }
table { float: snap-block(3em 2em, bottom) }
More examples with regions and elements as float references needed.

4. Stacking floats

Floats for any given line/column/region/page are placed in the order they appear in the source document. This means that floats that have been deferred from previous columns/regions/pages will be placed first, and thereafter floats from the current line/column/region/page.

Floats with the same float reference are made to never overlap. If the float reference is a column, region or page and the float containing context is limited in size, and there is not enough space to draw a particular float, that float is automatically deferred to the next column/region/page.

The stacking order of the floats within a related to a particular float reference are determined by the block flow and inline directions.

Detailed instructions and examples for float placement are needed, including how top/bottom and left/right floats interact, and how floats with different float references interact.

Examples and property definition of float-stacking-order needed! Such as "The first float with the float property set to a particular value is floated as the outermost element. The second as the second outermost element, etc. ."

5. The clear property

Name: clear
Value: inline-start | inline-end | block-start | block-end | left | right | top | bottom | none
Initial: none
Applies to: block-level elements, floats, regions, pages
Inherited: no
Percentages: N/A
Media: visual
Computed value: as specified.
Animatable: no

To prevent stacking of floats, the clear property can be used:

inline-start
If applied to a block-level element or a float with a float-reference set to inline, requires that the block-start outer edge of the box comes after the block-end outer edge of any inline-start-floats with an inline-start-float-reference that resulted from elements earlier in the source document.

If applied to a float with a float-reference set to column/region/page, it requires that the block-start outer edge of the box follows the block-end outer edge of any inline-start-floats with a inline-start-float-reference that resulted from elements earlier in the source document. If the float reference’s height is limited and there is insufficient space to place this float, it requires that this and all further inline-start-floats relating to the same float reference are deferred to the next page/column/region.

inline-end
If applied to a block-level element or a float with a float-reference set to inline, requires that the block-start outer edge of the box comes after the block-end outer edge of any inline-end-floats with an inline-end-float-reference that resulted from elements earlier in the source document.

If applied to a float with a float-reference set to column/region/page, it requires that the block-start outer edge of the box follows the block-end outer edge of any inline-end-floats with a inline-end-float-reference that resulted from elements earlier in the source document. If the float reference’s height is limited and there is insufficient space to place this float, it requires that this and all further inline-end-floats relating to the same float reference are deferred to the next page/column/region.

block-start
If applied to a block-level element or a float with a float-reference set to inline, behave like inline-start.

If applied to a float with a float-reference set to column/region/page, requires that this and all further block-start-floats relating to the same float reference are deferred to the next page/column/region.

block-end
If applied to a block-level element or a float with a float-reference set to inline, behave like inline-end.

If applied to a float with a float-reference set to column/region/page, requires that this and all further block-end-floats relating to the same float reference are deferred to the next page/column/region.

left
Behave like block-end, inline-start or inline-end depending on the float containing block’s direction and writing-mode.
right
Behave like block-start, inline-start or inline-end depending on the float containing block’s direction and writing-mode.
top
Behave like block-start or inline-start depending on the float containing block’s direction and writing-mode.
bottom
Behave like block-end or inline-end depending on the float containing block’s direction and writing-mode.
In this example, the two figures may appear in the same column:
.figure { float-reference: column; float: bottom; clear: none }

<div class=figure></div>
<div class=figure></div>

In this example, the two figures will appear in different columns:
.figure { float-reference: column; float: bottom; clear: bottom }

<div class=figure></div>
<div class=figure></div>

In this example, the two figures may appear at the bottom of the same column due to clearing only at the top:
.figure { float-reference: column; float: bottom; clear: top }

<div class=figure></div>
<div class=figure></div>

In this example, the two figures will appear in different columns due to clearing at the bottom:
.figure { float-reference: column; float: bottom; clear: bottom }

<div class=figure></div>
<div class=figure></div>

In this example, the two figures end up the top corner of two different pages:
.figure { float-reference: page; float: top; clear: top }

<div class=figure></div>
<div class=figure></div>
In this example, the two figures request different positions, and they may therefore end up in the same column:
.figure.one { float-reference: column; float: top; clear: top }
.figure.two { float-reference: column; float: bottom; clear: bottom }

<div class="figure one"></div>
<div class="figure two"></div>

6. Deferring floats

A float can be deferred to a following column/region/page, depending on its float reference. Floats with float-reference set to inline cannot be deferred.

Specified float deferring takes place before float stacking. Float stacking can lead to floats being deferred to the next column/region/page if the column/region/page they were targeted for originally lacks the required space.

This new property is introduced to control deferring floats:

6.1. The float-defer property

Name: float-defer
Value: <integer> | last | none
Initial: none
Applies to: floats
Inherited: no
Percentages: N/A
Media: visual
Computed value: as specified.
Animatable: no

This property specifies whether a floats should appear in their natural column/region/page, or in a following column/region/page. Values are:

none
the page float appears in the natural column/region/page
<integer>
A positive integer value indicates that the page float should be displayed in a following column/region/page. A negative integer value indicates that the page float should be displayed in a following column/region/page, counted from the last column/region/page. Zero is not a legal value.
Float figure to the top of the column that follows the natural column:
.figure { float-reference: column }
.figure { float: top }
.figure { float-defer: 1 }
Float figure to the top of the next-to-last column:
.figure { float-reference: column; float: top; float-defer: -1 }

sample rendering

Float figure to top of the last column of the multicol element on the current page:
.figure { float-reference: column; float: top; float-defer: last }

sample rendering

Float figure to the top of the first column on the next-to-last page:
.figure { float-reference: page }
.figure { float: top }
.figure { float-defer: -1 }
last
The page float should be displayed in the last colum, region or page.
Float figure to the top of the last column:
.figure { float-reference: column }
.figure { float: top }
.figure { float-defer: last }
none
The floats should appear in their natural column/region/page, if possible.

Zero is not a legal value.

7. Wrapping around floats

Floats have their wrap-flow property set to both initially and are treated like exclusions. This specification does not make any further specification about wrapping contents around floats.

Should the wrap-flow really be set to both, or should the flow be restricted to only be on one side?

8. The float-offset property

Name: float-offset
Value: <length> <length> ?
Initial: 0
Applies to: floats
Inherited: no
Percentages: N/A
Media: visual
Computed value: one or two absolute lengths
Animatable: no

This property pushes a float in opposite direction of the where it has been floated with float.

This property can only influence a float along an axis it has been floated.

img {
  float-reference: column;
  float: left;
  float-offset: 2em;
}

In this example, the image is floated to the left. Therefore, float-offset may only push the element to the right.

img {
  float-reference: column;
  float: right;
  float-offset: 5px;
}

sample rendering

Percentage values are computed according to this formula:

(containing-block-width - float-width) * percentage
(containing-block-height - float-height) * percentage
Pull quotes are often centered in a column. In this example, the pull quote is floated to the right, and then pushed back into the center.

.pullquote {
  float-reference: region;
  float: right;
  float-offset: 50%; /* 50% centers the box */
}

The body text in the example should wrap around both sides of the floated element to follow this specification.

9. Floats and absolutely positioned exclusions

Floats and absolutely positioned exclusions share some common traits, but in the case of inline floats they are not the same. Floats that are not inline floats should behave the same as absolutely positioned exclusions with positions and sizes manually set to prevent overlap between floats and to prevent floats from moving beyond the edges of the float reference, with the float reference being grown as much as needed up to its maximum extend to accommodate all containing floats.

9.1. Differences between inline floats and absolutely positioned elements

This section is not normative.

Inline floats and absolutely positioned elements are both out-of-flow elements. Absolutely positioned elements that are also exclusions can imitate many of the features of floats.

However, in the case of inline floats, the block formatting context that contains them (the float containing block formatting context) is required to include the area occupied by the float, which is not a requirement for absolutely positioned elements.

An inline float inside a float containing block formatting context given by a display-inline-block element. The element, which has a green border, is expanded to include the brown float.
<style>
.float {
  float: left;
  margin: 5px;
}
.border {
    border: 3px solid black;
    margin: 5px;
}
#outer {
    border: 1px solid green;
    display: inline-block;
}
canvas {
    background-color: brown;
}
p {
  margin: 5px;
}
</style>
<div id="outer">
    <p class="border">
        <span class="float border">
            <canvas width="100" height="100"/>
        </span>
        First paragraph.
    </p>
    <p class="border">
        Second paragraph and some more text.
    </p>
</div>

sample rendering

In comparison, the below is the same HTML, but the float is replaced by an absolutely positioned element that is also an exclusion. The float containing block formatting context is still given by a display-inline-block element. However, the element, marked by a green border, does not expand to include the brown, absolutely positioned element.

<style>
.float {
    position: absolute;
    top: 8px;
    left: 8px;
    wrap-flow: both;
}
.border {
    border: 3px solid black;
    margin: 5px;
}
#outer {
    border: 1px solid green;
    display: inline-block;
    position: relative;
}
canvas {
    background-color: brown;
}
</style>
<div id="outer">
    <p class="border">
        <span class="float border">
            <canvas width="100" height="100"/>
        </span>
        First paragraph.
    </p>
    <p class="border">
        Second paragraph and some more text.
    </p>
</div>

sample rendering

9.2. Page floats with float references with fixed heights

If a page floats are inside a float reference with a fixed height, the float reference is filled up until it cannot contain the following page float. All subsequent page floats are deferred to the next column/region/page.

9.3. Page floats with variable height float references with no maximum height

Variable height float references are grown to accommodate all its containing page floats. Page floats inside of variable height float references without a maximum height are therefore never deferred automatically.

9.4. Page floats with variable height float references with a set maximum height

Float references with a variable height with a set max height are grown to accommodate all of its containing page floats up to their maximum height. Subsequent page floats are deferred to the following column/region/page.

10. Overconstrained floats

In many cases, the specified values on these properties cannot be honored.

The number of columns is limited, and high values therefore cannot be honored:

.figure { float-reference: column; float: top; float-defer: 1000 }
A narrow screen may only have room for one column, in which case this request cannot be honored:
.figure { float-reference: column; float: top; float-defer: -5 }
In long documents, all content cannot fit on the last page, and this rule therefore cannot be honored:
p { float-reference: page; float: top; float-defer: last }

Floats are processed in the order they appear in the source. However, the visual order of floats may not be the same as the source order.

Consider this code:
.one { float-reference: page; float: top; float-defer: last }
.two { float-reference: column; float: top; clear: column }

<div class=one></div>
<div class=two></div>

In this example, the first element requests to appear on the last page, while the second element requests to appear in the natural column. If the natural column of the second element appears on a page before the last page, the second element will appear visually before the first.

Consider this code:

.one { float-reference: page; float: top; float-defer: last }
.two { float-reference: page; float: top; clear: page; }

<div class=one></div>
<div class=two></div>

If all content can fit on one page, the first page will also be the last page. The first element is processed first and is placed on top of the first page. Then the second element is processed. It requests a clear top, somthing which is not possible on the first page. Therefore, a second page is created and the first element is moved there. Even if the first element requests to be on the last page, it will not appear there.

When resolving over-constrained layouts, the order of importance for defined goals are:

  1. honor basic multi-column layout (columns, 'column-span: all', column-gap etc)
  2. honor 'column-span: <integer>'
  3. honor 'clear: top/bottom/pcolumn/page'
  4. honor float-defer
  5. honor 'float: top/bottom'
  6. display all content (as described by other CSS properties)
  7. keep the number of pages to a minimum

Changes

Changes from the 24 September 2013 CSS Page Floats Editor’s Draft

  1. Specified that block-start and block-end floats have an initial inline size of 100% and are placed at the inline-start.
  2. Simplified, removed advanced options that weren’t defined entirely.
  3. Switched to bikeshed document type
  4. Changed editor
  5. Removed sections on Regions and Exclusions
  6. Added float-reference
  7. Added possibility to float into regions
  8. Removed part about numeric column-span
  9. Removed possibility to defer for page and column independently for the same float
  10. Adjusted clear to work with pages/regions/columns
  11. Removed part about float inside/outside for pages

Acknowledgments

This specification is made possible by input from Tab Atkins Jr., David Baron, Lars Erik Bolstad, Bert Bos, Mike Bremford, Michael Day, Werner Donné, Brady Duga, James Elmore, Elika Etemad, Michel Fortin, Daniel Glazman, Melinda Grant, Ian Hickson, Laurens Holst, Brad Kemper, Toru Kawakubo, Rune Lillesveen, Peter Linss, Cameron McCormack, Paul E. Merrell, Del Merritt, Markus Mielke, Kelly Miller, Alex Mogilevsky, Peter Moulder, Shinyu Murakami, Michel Onoff, Anton Prowse, Liam R E Quin, Jacob Grundtvig Refstrup, Florian Rivoal, Christian Roth, Allan Sandfeld Jensen, Simon Sapin, Morten Stenshorne, Philip Taylor, Ian Tindale, Ladd Van Tol, Tarquin (Mark) Wilton-Jones, Steve Zilles, Tantek Çelik and the CSS Working Group members.

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.

Advisements are normative sections styled to evoke special attention and are set apart from other normative text with <strong class="advisement">, like this: UAs MUST provide an accessible alternative.

Conformance classes

Conformance to this specification is defined for three conformance classes:

style sheet
A CSS style sheet.
renderer
A UA that interprets the semantics of a style sheet and renders documents that use them.
authoring tool
A UA that writes a style sheet.

A style sheet is conformant to this specification if all of its statements that use syntax defined in this module are valid according to the generic CSS grammar and the individual grammars of each feature defined in this module.

A renderer is conformant to this specification if, in addition to interpreting the style sheet as defined by the appropriate specifications, it supports all the features defined by this specification by parsing them correctly and rendering the document accordingly. However, the inability of a UA to correctly render a document due to limitations of the device does not make the UA non-conformant. (For example, a UA is not required to render color on a monochrome monitor.)

An authoring tool is conformant to this specification if it writes style sheets that are syntactically correct according to the generic CSS grammar and the individual grammars of each feature in this module, and meet all other conformance requirements of style sheets as described in this module.

Partial implementations

So that authors can exploit the forward-compatible parsing rules to assign fallback values, CSS renderers must treat as invalid (and ignore as appropriate) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support. In particular, user agents must not selectively ignore unsupported component values and honor supported values in a single multi-value property declaration: if any value is considered invalid (as unsupported values must be), CSS requires that the entire declaration be ignored.

Experimental implementations

To avoid clashes with future CSS features, the CSS2.1 specification reserves a prefixed syntax for proprietary and experimental extensions to CSS.

Prior to a specification reaching the Candidate Recommendation stage in the W3C process, all implementations of a CSS feature are considered experimental. The CSS Working Group recommends that implementations use a vendor-prefixed syntax for such features, including those in W3C Working Drafts. This avoids incompatibilities with future changes in the draft.

Non-experimental implementations

Once a specification reaches the Candidate Recommendation stage, non-experimental implementations are possible, and implementors should release an unprefixed implementation of any CR-level feature they can demonstrate to be correctly implemented according to spec.

To establish and maintain the interoperability of CSS across implementations, the CSS Working Group requests that non-experimental CSS renderers submit an implementation report (and, if necessary, the testcases used for that implementation report) to the W3C before releasing an unprefixed implementation of any CSS features. Testcases submitted to W3C are subject to review and correction by the CSS Working Group.

Further information on submitting testcases and implementation reports can be found from on the CSS Working Group’s website at http://www.w3.org/Style/CSS/Test/. Questions should be directed to the public-css-testsuite@w3.org mailing list.

Index

Terms defined by this specification

Terms defined by reference

References

Normative References

[CSS-EXCLUSIONS-1]
CSS Exclusions Module Level 1 URL: http://www.w3.org/TR/css3-exclusions/
[CSS-MULTICOL-1]
CSS Multi-column Layout Module Level 1 URL: http://www.w3.org/TR/css3-multicol/
[CSS-VALUES-3]
CSS Values and Units Module Level 3 URL: http://www.w3.org/TR/css3-values/
[CSS-WRITING-MODES-3]
Elika Etemad; Koji Ishii. CSS Writing Modes Level 3. 20 March 2014. CR. URL: http://www.w3.org/TR/css-writing-modes-3/
[RFC2119]
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://tools.ietf.org/html/rfc2119

Property Index

Name Value Initial Applies to Inh. %ages Media Animatable Computed value
float-reference inline | column | region | page inline all elements. no N/A visual no as specified.
float block-start | block-end | inline-start | inline-end | snap-block | snap-inline | left | right | top | bottom | none none all elements. no N/A visual no as specified.
clear inline-start | inline-end | block-start | block-end | left | right | top | bottom | none none block-level elements, floats, regions, pages no N/A visual no as specified.
float-defer <integer> | last | none none floats no N/A visual no as specified.
float-offset <length> <length> ? 0 floats no N/A visual no one or two absolute lengths

Issues Index

Floats as defined here work with different types of fragmentation types (columns, regions, pages) as well as container elements. The specification is no longer specific to print or to pages. At the same time, inline floats and page floats differ in many ways, and it may (or may not) be a good idea to separate the two entirely. Therefore, the name CSS Page Floats should probably be replaced with a more appropriate name.
The float containing block formatting context having the same dimensions as the float reference means that all floats that are not inline floats cannot move outside of their float references. Is this wanted?
It is not possible to directly specify which element to use as the reference element. This may be of interest to have.

Maybe something like:

<style>
.float {
float-reference: float-container;
}

#container {
float-container: true;
}
</style>

<div id="container">
<p>First paragraph<span class="float">FLOAT</span></p>

<p>Second paragraph
<span class="inline-block">[<span class="float">FLOAT</span>] </span>
And some more text</p>
</div>
    

This should float both floats with reference to the <div id="container"> element, rather than the <P> and inline <SPAN> elements.

Should block-end and block-start floats be allowed to have an inline-size that is larger than the that of the float reference? What should happen in that case?
There is currently no way to float into a combination of directions (top right, right top, left bottom, bottom left, etc.).
Should the wrap-flow really be set to both, or should the flow be restricted to only be on one side?