8000 csswg-drafts/css-page-floats/Overview.html at a28b43cfa9bee1a6aadcb777b0c235b5845f885d · w3c/csswg-drafts · GitHub
Skip to content

Latest commit

 

History

History
1807 lines (1367 loc) · 48 KB

File metadata and controls

1807 lines (1367 loc) · 48 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang=en>
<head profile="http://dublincore.org/documents/2008/08/04/dc-html/ ">
<title>CSS Page Floats</title>
<link href="http://purl.org/dc/terms/" rel=schema.dcterms>
<link href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=dcterms.rights>
<meta content="CSS Page Floats" name=dcterms.title>
<meta content=text name=dcterms.type>
<meta content=2013-09-24 name=dcterms.date>
<meta content="Håkon Wium Lie" name=dcterms.creator>
<meta content=W3C name=dcterms.publisher>
<meta content="http://dev.w3.org/csswg/css-page-floats/"
name=dcterms.identifier>
<meta content="text/html; charset=utf-8" http-equiv=Content-Type>
<link href="../default.css" rel=stylesheet type="text/css">
<link href="http://www.w3.org/StyleSheets/TR/W3C-ED.css" rel=stylesheet
type="text/css">
<style type="text/css">
.example img { display: block }
.example { background: #ddd }
body { line-height: 1.3 }
.remove, .unimplemented { display: none }
table.string-set-example { font-family: monospace; border-collapse: collapse }
table.string-set-example div.pre {
width: 12em; white-space: pre;
}
table.string-set-example td {
padding: 0.3em;
border: thin solid black
}
</style>
<body>
<div class=head> <!--begin-logo-->
<p><a href="http://www.w3.org/"><img alt=W3C height=48
src="http://www.w3.org/Icons/w3c_home" width=72></a> <!--end-logo-->
<h1>CSS Page Floats</h1>
<h2 class="no-num no-toc" id=w3c-working>Editor's Draft 24 September 2013</h2>
<dl>
<dt>This version:
<dd><a
href="http://dev.w3.org/csswg/css-page-floats/">http://www.w3.org/TR/2013/ED-css3-gcpm-20130924/</a>
<dt>Latest version:
<dd><a
href="http://www.w3.org/TR/css3-gcpm/">http://www.w3.org/TR/css-page-floats/</a>
<!--
<dt>Previous version:
<dd><a href="http://www.w3.org/TR/2010/WD-css-page-floats/">
http://www.w3.org/TR/2010/WD-css-page-floats/</a>
-->
<dt>Feedback:
<dd><a
href="mailto:www-style@w3.org?subject=%5Bcss-gcpm%5D%20feedback">www-style@w3.org</a>
with subject line “<kbd>[css-page-floats] <var>… message topic
…</var></kbd>” (<a
href="http://lists.w3.org/Archives/Public/www-style/"
rel=discussion>archives</a>)
<dt>Editor:
<dd>Håkon Wium Lie, Opera Software, howcome@opera.com
</dl>
<!--begin-copyright-->
<p class=copyright><a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright"
rel=license>Copyright</a> © 2013 <a href="http://www.w3.org/"><abbr
title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a
935E
href="http://www.csail.mit.edu/"><abbr
title="Massachusetts Institute of Technology">MIT</abbr></a>, <a
href="http://www.ercim.eu/"><abbr
title="European Research Consortium for Informatics and Mathematics">ERCIM</abbr></a>,
<a href="http://www.keio.ac.jp/">Keio</a>, <a
href="http://ev.buaa.edu.cn/">Beihang</a>), All Rights Reserved. W3C <a
href="http://www.w3.org/Consortium/Legal/ipr-notice#Legal_Disclaimer">liability</a>,
<a
href="http://www.w3.org/Consortium/Legal/ipr-notice#W3C_Trademarks">trademark</a>
and <a
href="http://www.w3.org/Consortium/Legal/copyright-documents">document
use</a> rules apply.</p>
<!--end-copyright-->
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc" id=abstract>Abstract</h2>
<p>This module describes features often used in printed publications.
Figures and photos are often moved to the top or bottom of columns and
pages, along with their captions. Some elements (e.g., call-outs) push
aside other content in the flow of text, and sometimes one column is given
a different styling than others. This draft describes how to achieve these
effects, both on paper and screens.
<h2 class="no-num no-toc" id=status-of-this-document>Status of this
document</h2>
<!--begin-status-->
<p>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.
<p>The (<a
href="http://lists.w3.org/Archives/Public/www-style/">archived</a>) public
mailing list <a
href="mailto:www-style@w3.org?Subject=%5Bcss-page-floats%5D%20PUT%20SUBJECT%20HERE">
www-style@w3.org</a> (see <a
href="http://www.w3.org/Mail/Request">instructions</a>) 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<!---->] <em>…summary of comment…</em>”
<p>This document was produced by the <a
href="http://www.w3.org/Style/CSS/members">CSS Working Group</a> (part of
the <a href="http://www.w3.org/Style/">Style Activity</a>).
<p>This document was produced by a group operating under the <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/">5 February
2004 W3C Patent Policy</a>. W3C maintains a <a
href="http://www.w3.org/2004/01/pp-impl/32061/status"
rel=disclosure>public list of any patent disclosures</a> 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 <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential">Essential
Claim(s)</a> must disclose the information in accordance with <a
href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section
6 of the W3C Patent Policy</a>.</p>
<!--end-status-->
<p>This WD contains functionality that the CSS WG finds interesting and
useful. The described functionality has been split off from <a
href="#CSS3GCPM" rel=biblioentry>[CSS3GCPM]<!--{{CSS3GCPM}}--></a> draft.
<h2 class="no-num no-toc" id=table-of-contents><a name=contents>Table of
contents</a></h2>
<!--begin-toc-->
<ul class=toc>
<li class=no-num><a href="#introduction">Introduction</a>
<li><a href="#page-floats"><span class=secno>1. </span>Page floats</a>
<ul class=toc>
<li><a href="#floating-to-the-topbottom-top-bottom-sna"><span
class=secno>1.1. </span>Floating to the top/bottom: top, bottom,
snap</a>
<li><a href="#spanning-columns"><span class=secno>1.2. </span>Spanning
columns</a>
<li><a href="#deferring-floats-float-defer-column-floa"><span
class=secno>1.3. </span>Deferring floats: float-defer-column,
float-defer-page</a>
<ul class=toc>
<li><a href="#float-defer-column"><span class=secno>1.3.1.
</span>‘<code class=property>float-defer-column</code>’</a>
<li><a href="#float-defer-page"><span class=secno>1.3.2.
</span>‘<code class=property>float-defer-page</code>’</a>
</ul>
<li><a href="#clearing-page-floats"><span class=secno>1.4.
</span>Clearing page floats</a>
<li><a href="#floating-inside-and-outside-pages"><span class=secno>1.5.
</span>Floating inside and outside pages</a>
<li><a href="#wrapping-around-page-floats"><span class=secno>1.6.
</span>Wrapping around page floats</a>
<li><a href="#the-float-offset-property"><span class=secno>1.7.
</span>The ‘<code class=property>float-offset</code>’ property</a>
<li><a href="#overconstrained-page-floats"><span class=secno>1.8.
</span>Overconstrained page floats</a>
</ul>
<li><a href="#exclusions"><span class=secno>2. </span>Exclusions</a>
<ul class=toc>
<li><a href="#the-clear-side-property"><span class=secno>2.1. </span>The
‘<code class=property>clear-side</code>’ property</a>
<li><a href="#exclusions-based-on-images"><span class=secno>2.2.
</span>Exclusions based on images</a>
<li><a href="#exclusions-based-on-rendered-content"><span
class=secno>2.3. </span>Exclusions based on rendered content</a>
<li><a href="#exclusions-based-on-shapes"><span class=secno>2.4.
</span>Exclusions based on shapes</a>
</ul>
<li><a href="#regions"><span class=secno>3. </span>Regions</a>
<li><a href="#regions-and-exclusions-examples"><span class=secno>4.
</span>Regions and Exclusions examples</a>
<li><a href="#conformance"><span class=secno>5. </span>Conformance</a>
<li class=no-num><a href="#acknowledgments">Acknowledgments</a>
<li class=no-num><a href="#references">References</a>
<ul class=toc>
<li class=no-num><a href="#normative-references">Normative
references</a>
<li class=no-num><a href="#other-references">Other references</a>
</ul>
<li class=no-num><a href="#index">Index</a>
<li class=no-num><a href="#property-index">Property index</a>
</ul>
<!--end-toc-->
<h2 class=no-num id=introduction>Introduction</h2>
<p>(This section is not normative.)
<p>This module describes features often used in printed publications.
Figures and photos are often moved to the top or bottom of columns and
pages, along with their captions. Some elements (e.g., call-outs) push
aside other content in the flow of text, and sometimes one column is given
a different styling than others. This draft describes how to achieve these
effects, both on paper and screens.
<h2 id=page-floats><span class=secno>1. </span>Page floats</h2>
<p>In page-based layouts, images and figures are often displayed at the top
or bottom of pages. This specificaton adds new keywords on the ‘<code
class=property>float</code>’ property to create <em>page floats</em>. A
page float can float inside its natural column/page, or its placement can
be deferred to a following column/page with the <em>float-defer</em>
properties. Page floats can be set to span several columns, thereby
supporting commonly used newspaper layouts. New values on the ‘<code
class=property>clear</code>’ property adds further ways of refining
layouts with page floats.
<p class=note>Not all multicol elements are constrained by the page box.
Therefore, a more accurate term for page floats may be <em>column
floats</em> as all of them are constrained by the column box. However, in
most cases, page floats seems like a better term.
<h3 id=floating-to-the-topbottom-top-bottom-sna><span class=secno>1.1.
</span>Floating to the top/bottom: top, bottom, snap</h3>
<p>These new keywords on ‘<code class=property>float</code>’ have been
added:
<dl>
<dt>top
<dd>The float is floated to the top of the column
<dt>bottom
<dd>The float is floated to the bottom of the column <!--
<dt>top-corner
<dd>the box is floated to the top of the last column (in the inline direction) that fits inside the multicol element on the same page.
<dt>bottom-corner
<dd>similar to 'top-corner', exept the box is floated to the bottom
-->
<dt>snap(&lt;length> &lt;length>? [, top | bottom | near ]?)
<dd>
<p>Makes the element float to the top or bottom if it naturally appears
within a certain distance from the top or bottom. The length value(s)
specifies the maxium distance from the top/bottom that an element must
be within in order to be floated; one length value specifies the
distance from both the top and the bottom, two length values specify the
distance from the top and bottom, respectively.
<p>The optional keyword value specifies where the element is floated:
top, bottom, or the nearest of the two. The initial value is ‘<code
class=property>near</code>’. If ‘<code class=property>near</code>’
is in effect and the element is within the specified distance both from
the top and the bottom, bottom wins.
<p>An element is considered to be a float if it has a snap() 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.
<dt>snap
<dd>same as <tt>snap(2em, near)</tt>
</dl>
<p>These new keywords only apply in paged media; in continous media
declarations with these keywords are ignored.
<p>Elements with any of these new keywords are called ‘<code
class=css>page floats</code>’. Each page float has a <em>natural
column</em>, which is the column where the element would have started to
appears it it was not a float. Also, each page float has a <em>natural
page</em>, which is the page where the element would have started if the
was not a float. Unless other constrained by lack of space or other
float-* properties, page floats should appear in their natural column on
the natural page.
<div class=example>
<p>Float figure to top of natural column:
<pre>
.figure { float: top }
</pre>
<img alt="sample rendering" src=7.png></div>
<div class=example>
<pre>
.figure { float: top; width: 50% }
</pre>
<img alt="sample rendering" src=7b.png></div>
<div class=example>
<p>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
< 8096 div>
therefore placed in the second column, leaving white space at the bottom
of the first column.</p>
<img alt="sample rendering" src=23.png>
<p>To avoid the white space, the image can be floated to the nearest edge
(in the block direction):
<pre>
.figure { float: snap }
</pre>
<p>In this example, the figure is already at the nearest edge, so it does
not move. However, page floats allow subsequent content to be displayed
before the page float and the white space can therefore be filled:</p>
<img alt="sample rendering" src=7.png></div>
<div class=example>
<p>In this example, two figures naturally appear in the text flow:</p>
<img alt="sample rendering" src=20.png>
<p>A typographer would typically try to avoid single lines of text
above/below figures, which can be achieved with:
<pre>
div.figure { float: snap(1.5em) }
</pre>
<p>The length value specifies the reach of the snap function; in this
example the second figure is affected, but not the first.
</div>
<div class=example>
<p>In this example, two figures naturally appear in the text flow:</p>
<img alt="sample rendering" src=20.png>
<p>To make the figures snap to the nearest edges, this code can be
applied:
<pre>
div.figure { float: snap(2.5em) }
</pre>
<p>The resultant rendering is:</p>
<img alt="sample rendering" src=22.png></div>
<div class=example>
<p>Float figure to top of the natural column, spanning all columns:
<pre>
.figure { float: top; column-span: all }
</pre>
<img alt="sample redering" src=15.png></div>
<div class=example>
<p>In this example, tables will snap to the top/bottom if the top/bottom
of the border box is closer than ‘<code class=css>3em</code>’ from
the top/bottom of the page/column.
<pre>
table { float: snap }
table { float: snap(3em) }
table { float: snap(3em, bottom) }
table { float: snap(3em 2em, bottom) }
</pre>
</div>
<p class=issue>Do numeric values, to represent line numbers, make sense,
like for orphans/widows?
<h3 id=spanning-columns><span class=secno>1.2. </span>Spanning columns</h3>
<p>The ‘<code class=property>column-span</code>’ property is extended
with integer values so that elements can span several columns. If the
specified integer value is equal to, or larger than the number of columns
in the multicol element, the number of columns spanned will be the same as
if ‘<code class=css>column-span: all</code>’ had been specified.
<div class=example>
<p>In this example, a commonly used newspaper layout is easily described:
<pre>
body { columns: 3 }
img.A { column-span: 2; width: 100% } /* image spans two columns */
.one { column-span: 2 } /* lead paragraph spans two columns */
</pre>
<img alt="sample rendering" src=regions.png></div>
<p>Further, the ‘<code class=property>page</code>’ value is added to
‘<code class=property>column-span</code>’ so that the page (and not
the column or element) becomes the reference.
<div class=example>
<p>In this example, the footer is floated to the bottom of the last page
(and not the bottom of the article element):
<pre>
footer { float: bottom; column-span: page }
&lt;article>
...
&lt;footer>...&lt;.footer>
&lt;/article>
</pre>
</div>
<p class=issue>An alternative way to express this would be to add a
separate propertye, e.g., <code>float-reference: column | multicol |
page</code>
<h3 id=deferring-floats-float-defer-column-floa><span class=secno>1.3.
</span>Deferring floats: float-defer-column, float-defer-page</h3>
<p>A page float can be deferred to a following column/page with these new
properties:
<h4 id=float-defer-column><span class=secno>1.3.1. </span>‘<a
href="#float-defer-column0"><code
class=property>float-defer-column</code></a>’</h4>
<table class=propdef>
<tbody>
<tr>
<td><em>Name:</em>
<td><dfn id=float-defer-column0>float-defer-column</dfn>
<tr>
<td><em>Value:</em>
<td>&ltinteger> | last | 12C8 none
<tr>
<td><em>Initial:</em>
<td>none
<tr>
<td><em>Applies to:</em>
<td>page floats
<tr>
<td><em>Inherited:</em>
<td>no
<tr>
<td><em>Percentages:</em>
<td>N/A
<tr>
<td><em>Media:</em>
<td>visual
<tr>
<td><em>Computed value:</em>
<td>specified value
</table>
<h4 id=float-defer-page><span class=secno>1.3.2. </span>‘<a
href="#float-defer-page0"><code
class=property>float-defer-page</code></a>’</h4>
<table class=propdef>
<tbody>
<tr>
<td><em>Name:</em>
<td><dfn id=float-defer-page0>float-defer-page</dfn>
<tr>
<td><em>Value:</em>
<td>&ltinteger> | last | none
<tr>
<td><em>Initial:</em>
<td>none
<tr>
<td><em>Applies to:</em>
<td>page floats
<tr>
<td><em>Inherited:</em>
<td>no
<tr>
<td><em>Percentages:</em>
<td>N/A
<tr>
<td><em>Media:</em>
<td>visual
<tr>
<td><em>Computed value:</em>
<td>specified value
</table>
<p>These properties specify whether page floats should appear in their
natural column/page, or in a following column/page. Values are:
<dl>
<dt>none
<dd>the page float appears in the natural column/page
<dt>&lt;integer>
<dd>A positive integer value indicates that the page float should be
displayed in a following column/page. A negative integer value indicates
that the page float should be displayed in a following column/page,
counted from the last column/page. When counting columns, the starting
point is the last column of the multicol element on the natural page.
When counting pages, the starting point is the last page of the multicol
element.
</dl>
<div class=example>
<p>Float figure to the top of the column that follows the natural column:
<pre>
.figure { float: top }
.figure { float-defer-column: 1 }
</pre>
</div>
<div class=example>
<p>Float figure to the top of the next-to-last column:
<pre>
.figure { float: top; float-defer-column: -1 }
</pre>
<img alt="sample rendering" src=7.png></div>
<div class=example>
<p>Float figure to top of the last column of the multicol element on the
current page:
<pre>
.figure { float: top; float-defer-column: last }
</pre>
<img alt="sample rendering" src=6.png></div>
<div class=example>
<p>In combination with ‘<code class=property>column-span</code>’, the
figure is floated to the top corner of the multicol element on that page:
<pre>
.figure { float: top; column-span: 2; float-defer-column: last; width: 100% }
</pre>
<img alt="sample rendering" src=8.png></div>
<div class=example>
<p>Float figure to the top of the second column, spanning two columns:
<pre>
.figure {
float: top; column-span: 2;
float-defer-column: 1;
}
</pre>
<img alt="sample rendering" src=18.png></div>
<div class=example>
<p>Float figure to the top right, leaving one full column:
<pre>
.figure {
float: top; column-span: 2;
float-defer-column: -1;
}
</pre>
<img alt="sample rendering" src=18.png>
<p>Given that there are four columnn, the same layout would be achived
with this code:
<pre>
.figure {
float: top; column-span: 2;
float-defer-column: 1;
}
</pre>
</div>
<div class=example>
<p>Float figure to the top of the first column on the next-to-last page:
<pre>
.figure { float: top }
.figure { float-defer-page: -1 }
</pre>
</div>
<div class=example>
<p>Float figure to the top of the next-to-last column on the next-to-last
page:
<pre>
.figure { float: top }
.figure { float-defer-column: -1 }
.figure { float-defer-page: -1 }
</pre>
</div>
<dl>
<dt>last
<dd>The page float should be displayed in the last colum, or on the last
page.
<div class=example>
<p>Float figure to the top of the last column on the natural page:
<pre>
.figure { float: top }
.figure { float-defer-column: last }
</pre>
<img alt="sample rendering" src=6.png></div>
<div class=example>
<p>Float figure to the last column on the last page:
<pre>
.figure { float: top }
.figure { float-defer-column: last }
.figure { float-defer-page: last }
</pre>
</div>
<dt>none
<dd>The page floats should appear in their natural column/page, if
possible.
</dl>
<p>Zero is not a legal value.
<h3 id=clearing-page-floats><span class=secno>1.4. </span>Clearing page
floats</h3>
<p>Page floats may request to not be stacked, or to be the only page float
on a page/column through new values on the ‘<code
class=property>clear</code>’ property:
<dl>
<dt>top/bottom
<dd>The page float requests to be the only page float at the top/bottom of
the column. If there is already a page float at the requested position,
the page float is moved to the next column which does not have a page
float in the requested position.
<dt>column
<dd>The page float requests to be the only page float in the column. If
there is already another page float on the page, the page float is moved
to the next page which does not have a page float.
<dt>page
<dd>The page float requests to be the only page float on the page. If
there is already another page float on the page, the page float is moved
to the next page which does not have a page float.
</dl>
<div class=example>
<p>In this example, the two figures may appear in the same column:
<pre>
.figure { float: bottom; clear: none }
&ltdiv class=figure>&lt;/div>
&ltdiv class=figure>&lt;/div>
</pre>
<img src=16.png></div>
<div class=example>
<p>In this example, the two figures will appear in different columns:
<pre>
.figure { float: bottom; clear: column }
&ltdiv class=figure>&lt;/div>
&ltdiv class=figure>&lt;/div>
</pre>
<img src=17.png></div>
<div class=example>
<p>In this example, the two figures may appear at the bottom of the same
column due to clearing only at the top:
<pre>
.figure { float: bottom; clear: top }
&ltdiv class=figure>&lt;/div&g 12C8 t;
&ltdiv class=figure>&lt;/div>
</pre>
<img src=16.png></div>
<div class=example>
<p>In this example, the two figures will appear in different columns due
to clearing at the bottom:
<pre>
.figure { float: bottom; clear: bottom }
&ltdiv class=figure>&lt;/div>
&ltdiv class=figure>&lt;/div>
</pre>
<img src=17.png></div>
<div class=example>
<p>In this example, the two figures end up the top corner of two different
pages:
<pre>
.figure { float: top; float-defer-column: last; clear: page }
&ltdiv class=figure>&lt;/div>
&ltdiv class=figure>&lt;/div>
</pre>
</div>
<div class=example>
<p>In this example, the two figures request different positions, and they
may therefore end up in the same column:
<pre>
.figure.one { float: top; clear: top }
.figure.two { float: bottom; clear: bottom }
&ltdiv class="figure one">&lt;/div>
&ltdiv class="figure two">&lt;/div>
</pre>
</div>
<h3 id=floating-inside-and-outside-pages><span class=secno>1.5.
</span>Floating inside and outside pages</h3>
<p>Two allow content to flow to the inside and outside of a page, these
keywords are added to the ‘<code class=property>float</code>’
property:
<dl>
<dt>inside
<dd>On a right page, this value is synonymous with ‘<code
class=property>left</code>’. On a left page, this value is synonymous
with ‘<code class=property>right</code>’.
<dt>outside
<dd>On a left page, this value is synonymous with ‘<code
class=property>left</code>’, On a right page, this value is synonymous
with ‘<code class=property>right</code>’.
</dl>
<p>These new values do not create page floats, the are simply aliases for
‘<code class=property>left</code>’ and ‘<code
class=property>right</code>’.
<div class=example>
<pre>
.figure { float: outside }
</pre>
</div>
<p class=issue>Should there be a way to combine float: top/bottom with
left/right?
<p class=issue>Should there be a way to delete page floats that end up
lonesome on pages?
<h3 id=wrapping-around-page-floats><span class=secno>1.6. </span>Wrapping
around page floats</h3>
<table class=propdef>
<tbody>
<tr>
<td><em>Name:</em>
<td><dfn id=float-wrap>float-wrap</dfn>
<tr>
<td><em>Value:</em>
<td>none | wrap
<tr>
<td><em>Initial:</em>
<td>none
<tr>
<td><em>Applies to:</em>
<td>page floats
<tr>
<td><em>Inherited:</em>
<td>no
<tr>
<td><em>Percentages:</em>
<td>N/A
<tr>
<td><em>Media:</em>
<td>visual
<tr>
<td><em>Computed value:</em>
<td>specified value
</table>
<p>This property indicates whether other content may wrap around a page
float:
<dl>
<dt>none
<dd>other content may not wrap around the page float
<dt>wrap
<dd>other content may wrap around the page float
</dl>
<p>The ‘<code class=property>intrude</code>’ value only works in
combination with one of these keywords: ‘<code
class=property>left</code>’/‘<code
class=property>right</code>’/‘<code
class=property>top</code>’/‘<code
class=property>bottom</code>’/‘<code
class=property>top-corner</code>’/‘<code
class=property>bottom-corner</code>’.
<div class=example>
<pre class=css>
img { float: top; column-span: 2; float-wrap: wrap; width: 120%; }
</pre>
<p>In this example, the image is wider than the column and will therefore
intrude into the neighboring column. At the bottom of the middle column
is a long word that is clipped in the middle of the column gap. <img
alt="sample rendering" src=1.png>
</div>
<h3 id=the-float-offset-property><span class=secno>1.7. </span>The ‘<a
href="#float-offset"><code class=property>float-offset</code></a>’
property</h3>
<table class=propdef>
<tbody>
<tr>
<td><em>Name:</em>
<td><dfn id=float-offset>float-offset</dfn>
<tr>
<td><em>Value:</em>
<td>&lt;length> &lt;length> ?
<tr>
<td><em>Initial:</em>
<td>0 0
<tr>
<td><em>Applies to:</em>
<td>floated elements
<tr>
<td><em>Inherited:</em>
<td>no
<tr>
<td><em>Percentages:</em>
<td>see prose
<tr>
<td><em>Media:</em>
<td>visual, paged
<tr>
<td><em>Computed value:</em>
<td>one or two absolute lengths
</table>
<p>This property pushes a float in opposite direction of the where it has
been floated with ‘<code class=property>float</code>’. If one value is
specified, it is the horizontal offset. If two values are specified, the
first is the horizontal and the second is the vertical offset. If no
vertical value has been specified, the vertical offset is set to zero.
<p>This property can only influence a float along an axis it has been
floated.
<div class=example>
<pre>
img {
float: left;
float-offset: 2em 3em;
}
</pre>
<p>In this example, the image is floated to the left. Therefore, ‘<a
href="#float-offset"><code class=property>float-offset</code></a>’ may
only push the element in the horizontal direction, and the vertical value
is ignored.
</div>
<p>Negative values are allowed; a negative values will push the float in
the same direction as it has been floated with ‘<code
class=property>float</code>’
<p>This property may move floats into other column than where they
naturally appear.
<div class=example>
<pre>img {
float: right;
float-offset: 5px;
}
</pre>
<img alt="sample rendering" src=14.png></div>
<p>Percentage values are computed according to this formula:
<pre>
(containing-block-width - float-width) * percentage
(containing-block-height - float-height) * percentage
</pre>
<div class=example> 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. <img src="exclusion_wrap_side_left.png" width=213>
<pre>
.pullquote {
float: right;
float-offset: 50%; /* 50% centers the box */
}
</pre>
</div>
<p>When negative values are set on this property, the column gap is also
part of the calculation:
<pre>
((containing-block-width + 2 * column-gap) - float-width) * percentage
</pre>