E78E csswg-drafts/css-ui/Overview.html at 6c96f4c047eda60fa267d04c269113fe562bad18 · w3c/csswg-drafts · GitHub
Skip to content

Latest commit

 

History

History
2168 lines (2134 loc) · 169 KB

File metadata and controls

2168 lines (2134 loc) · 169 KB
<!doctype html><html lang="en">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>CSS Basic User Interface Module Level 3 (CSS3 UI)</title>
<meta content="testing" name="csswg-work-status">
<meta content="ED" name="w3c-status">
<link href="../default.css" rel="stylesheet" type="text/css">
<link href="../csslogo.ico" rel="shortcut icon" type="image/x-icon">
<style>
body {
background: url("https://www.w3.org/StyleSheets/TR/logo-ED") top left no-repeat white;
background-attachment: fixed;
color: black;
font-family: sans-serif;
margin: 0 auto;
max-width: 50em;
padding: 2em 1em 2em 70px;
}
:link { color: #00C; background: transparent }
:visited { color: #609; background: transparent }
a[href]:active { color: #C00; background: transparent }
a[href]:hover { background: #ffa }
a[href] img { border-style: none }
h1, h2, h3, h4, h5, h6 { text-align: left }
h1, h2, h3 { color: #005A9C; }
h1 { font: 170% sans-serif }
h2 { font: 140% sans-serif }
h3 { font: 120% sans-serif }
h4 { font: bold 100% sans-serif }
h5 { font: italic 100% sans-serif }
h6 { font: small-caps 100% sans-serif }
.hide { display: none }
div.head { margin-bottom: 1em }
div.head h1 { margin-top: 2em; clear: both }
div.head table { margin-left: 2em; margin-top: 2em }
p.copyright { font-size: small }
p.copyright small { font-size: small }
pre { margin-left: 2em }
dt { font-weight: bold }
ul.toc, ol.toc {
list-style: none;
}
</style>
<meta content="Bikeshed 1.0.0" name="generator">
<script defer="" src="//test.csswg.org/harness/annotate.js#css-ui-3_dev/css-ui-3" type="text/javascript"></script>
<style>#awesome-table td {padding:5px}</style>
<style>.highlight .hll { background-color: #ffffcc }
.highlight { background: #ffffff; }
.highlight .c { color: #708090 } /* Comment */
.highlight .k { color: #990055 } /* Keyword */
.highlight .l { color: #669900 } /* Literal */
.highlight .n { color: #0077aa } /* Name */
.highlight .o { color: #999999 } /* Operator */
.highlight .p { color: #999999 } /* Punctuation */
.highlight .cm { color: #708090 } /* Comment.Multiline */
.highlight .cp { color: #708090 } /* Comment.Preproc */
.highlight .c1 { color: #708090 } /* Comment.Single */
.highlight .cs { color: #708090 } /* Comment.Special */
.highlight .kc { color: #990055 } /* Keyword.Constant */
.highlight .kd { color: #990055 } /* Keyword.Declaration */
.highlight .kn { color: #990055 } /* Keyword.Namespace */
.highlight .kp { color: #990055 } /* Keyword.Pseudo */
.highlight .kr { color: #990055 } /* Keyword.Reserved */
.highlight .kt { color: #990055 } /* Keyword.Type */
.highlight .ld { color: #669900 } /* Literal.Date */
.highlight .m { color: #990055 } /* Literal.Number */
.highlight .s { color: #669900 } /* Literal.String */
.highlight .na { color: #0077aa } /* Name.Attribute */
.highlight .nc { color: #0077aa } /* Name.Class */
.highlight .no { color: #0077aa } /* Name.Constant */
.highlight .nd { color: #0077aa } /* Name.Decorator */
.highlight .ni { color: #0077aa } /* Name.Entity */
.highlight .ne { color: #0077aa } /* Name.Exception */
.highlight .nf { color: #0077aa } /* Name.Function */
.highlight .nl { color: #0077aa } /* Name.Label */
.highlight .nn { color: #0077aa } /* Name.Namespace */
.highlight .py { color: #0077aa } /* Name.Property */
.highlight .nt { color: #0077aa } /* Name.Tag */
.highlight .nv { color: #0077aa } /* Name.Variable */
.highlight .ow { color: #999999 } /* Operator.Word */
.highlight .mb { color: #990055 } /* Literal.Number.Bin */
.highlight .mf { color: #990055 } /* Literal.Number.Float */
.highlight .mh { color: #990055 } /* Literal.Number.Hex */
.highlight .mi { color: #990055 } /* Literal.Number.Integer */
.highlight .mo { color: #990055 } /* Literal.Number.Oct */
.highlight .sb { color: #669900 } /* Literal.String.Backtick */
.highlight .sc { color: #669900 } /* Literal.String.Char */
.highlight .sd { color: #669900 } /* Literal.String.Doc */
.highlight .s2 { color: #669900 } /* Literal.String.Double */
.highlight .se { color: #669900 } /* Literal.String.Escape */
.highlight .sh { color: #669900 } /* Literal.String.Heredoc */
.highlight .si { color: #669900 } /* Literal.String.Interpol */
.highlight .sx { color: #669900 } /* Literal.String.Other */
.highlight .sr { color: #669900 } /* Literal.String.Regex */
.highlight .s1 { color: #669900 } /* Literal.String.Single */
.highlight .ss { color: #669900 } /* Literal.String.Symbol */
.highlight .vc { color: #0077aa } /* Name.Variable.Class */
.highlight .vg { color: #0077aa } /* Name.Variable.Global */
.highlight .vi { color: #0077aa } /* Name.Variable.Instance */
.highlight .il { color: #990055 } /* Literal.Number.Integer.Long */
.highlight { background: hsl(24, 20%, 95%); }
code.highlight { padding: .1em; border-radius: .3em; }
pre.highlight, pre > code.highlight { display: block; padding: 1em; margin: .5em 0; overflow: auto; border-radius: 0; }
</style>
</head>
<body class="h-entry">
<div class="head">
<p data-fill-with="logo"><a class="logo" href="http://www.w3.org/"> <img alt="W3C" height="48" src="https://www.w3.org/Icons/w3c_home" width="72"> </a> </p>
<h1 class="p-name no-ref" id="title">CSS Basic User Interface Module Level 3 (CSS3 UI)</h1>
<h2 class="no-num no-toc no-ref heading settled" id="subtitle"><span class="content">Editor’s Draft, <time class="dt-updated" datetime="2015-09-29">29 September 2015</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt>This version:
<dd><a class="u-url" href="http://dev.w3.org/csswg/css-ui/">http://dev.w3.org/csswg/css-ui/</a>
<dt>Latest version:
<dd><a href="http://www.w3.org/TR/css3-ui/">http://www.w3.org/TR/css3-ui/</a>
<dt>Previous Versions:
<dd><a href="http://www.w3.org/TR/2015/WD-css3-ui-20150707/" rel="previous">http://www.w3.org/TR/2015/WD-css3-ui-20150707/</a>
<dt>Feedback:
<dd><span><a href="mailto:www-style@w3.org?subject=%5Bcss-ui%5D%20YOUR%20TOPIC%20HERE">www-style@w3.org</a> with subject line “<kbd>[css-ui] <var>… message topic …</var></kbd>” (<a href="http://lists.w3.org/Archives/Public/www-style/" rel="discussion">archives</a>)</span>
<dt>Test Suite:
<dd><a href="http://test.csswg.org/suites/css-ui-3_dev/nightly-unstable/">http://test.csswg.org/suites/css-ui-3_dev/nightly-unstable/</a>
<dt>Issue Tracking:
<dd><a href="https://github.com/w3c/csswg-drafts/issues/">GitHub</a>
<dd><span><a href="https://wiki.csswg.org/spec/css3-ui">https://wiki.csswg.org/spec/css3-ui</a></span>
<dt class="editor">Editors:
<dd class="editor p-author h-card vcard"><a class="p-name fn u-url url" href="http://tantek.com">Tantek Çelik</a> (<a class="p-org org" href="https://www.mozilla.org/en-US/">Mozilla</a>) <a class="u-email email" href="mailto:tantek@cs.stanford.edu">tantek@cs.stanford.edu</a>
<dd class="editor p-author h-card vcard"><a class="p-name fn u-url url" href="http://florian.rivoal.net">Florian Rivoal</a> (<span class="p-org org">Invited Expert</span>) <a class="u-email email" href="mailto:florian@rivoal.net">florian@rivoal.net</a>
</dl>
</div>
<div data-fill-with="warning"></div>
<p class="copyright" data-fill-with="copyright"><a href="http://www.w3.org/Consortium/Legal/ipr-notice#Copyright">Copyright</a> © 2015 <a href="http://www.w3.org/"><abbr title="World Wide Web Consortium">W3C</abbr></a><sup>®</sup> (<a 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>). 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>
<hr title="Separator for header">
</div>
<h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2>
<div class="p-summary" data-fill-with="abstract">
<p>This specification describes user interface related
properties and values that are proposed for CSS level 3
to style HTML and XML (including XHTML).
It includes and extends user interface related features from the
properties and values of CSS level 2 revision 1.
It uses various
properties and values to style basic user interface elements in a document.</p>
<a href="http://www.w3.org/TR/CSS/">CSS</a> is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, in speech, etc.
</div>
<h2 class="no-num no-toc no-ref heading settled" id="status"><span class="content">Status of this document</span></h2>
<div data-fill-with="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>
<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-ui%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-ui” in the subject,
preferably like this:
“[css-ui] <em>…summary of comment…</em>” </p>
<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>
<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 acco E719 rdance with <a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure">section 6 of the W3C Patent Policy</a>. </p>
<p> This document is governed by the <a href="http://www.w3.org/2015/Process-20150901/" id="w3c_process_revision">1 September 2015 W3C Process Document</a>. </p>
<p></p>
</div>
<div data-fill-with="at-risk">
<p>The following features are at-risk, and may be dropped during the CR period: </p>
<ul>
<li>The <a class="property" data-link-type="propdesc" href="#propdef-caret-color">caret-color</a> property
<li>The <a href="#overflow-string">&lt;string></a> value of the <a class="property" data-link-type="propdesc" href="#propdef-text-overflow">text-overflow</a> property
<li>The 2-value syntax of the <a class="property" data-link-type="propdesc" href="#propdef-text-overflow">text-overflow</a> property
<li>Constraints on <a href="#negative-offset">negative values</a> of the <a class="property" data-link-type="propdesc" href="#propdef-outline-offset">outline-offset</a> property being expressed with MUST rather than with SHOULD
</ul>
<p>“At-risk” is a W3C Process term-of-art, and does not necessarily imply that the feature is in danger of being dropped or delayed. It means that the WG believes the feature may have difficulting being interoperably implemented in a timely manner, and marking it as such allows the WG to drop the feature if necessary when transitioning to the Proposed Rec stage, without having to publish a new Candidate Rec without the feature first.</p>
</div>
<h2 class="no-num no-toc no-ref heading settled" id="contents"><span class="content">Table of Contents</span></h2>
<div data-fill-with="table-of-contents" role="navigation">
<ul class="toc" role="directory">
<li>
<a href="#intro"><span class="secno">1</span> <span class="content">Introduction</span></a>
<ul class="toc">
<li><a href="#purpose"><span class="secno">1.1</span> <span class="content">Purpose</span></a>
</ul>
<li><a href="#interaction"><span class="secno">2</span> <span class="content">Module Interactions</span></a>
<li>
<a href="#box-model"><span class="secno">3</span> <span class="content">Box Model addition</span></a>
<ul class="toc">
<li><a href="#box-sizing"><span class="secno">3.1</span> <span class="content"><span class="property">box-sizing</span> property</span></a>
</ul>
<li>
<a href="#outline-props"><span class="secno">4</span> <span class="content">Outline properties</span></a>
<ul class="toc">
<li><a href="#outline"><span class="secno">4.1</span> <span class="content"><span class="property">outline</span> property</span></a>
<li><a href="#outline-width"><span class="secno">4.2</span> <span class="content"><span class="property">outline-width</span> property</span></a>
<li><a href="#outline-style"><span class="secno">4.3</span> <span class="content"><span class="property">outline-style</span> property</span></a>
<li><a href="#outline-color"><span class="secno">4.4</span> <span class="content"><span class="property">outline-color</span> property</span></a>
<li><a href="#outline-offset"><span class="secno">4.5</span> <span class="content"><span class="property">outline-offset</span> property</span></a>
</ul>
<li>
<a href="#resizing-and-overflow"><span class="secno">5</span> <span class="content">Resizing &amp; Overflow</span></a>
<ul class="toc">
<li><a href="#resize"><span class="secno">5.1</span> <span class="content"><span class="property">resize</span> property</span></a>
<li><a href="#text-overflow"><span class="secno">5.2</span> <span class="content"> Overflow Ellipsis: the <span class="property">text-overflow</span> property</span></a>
</ul>
<li>
<a href="#pointing-keyboard"><span class="secno">6</span> <span class="content">Pointing Devices and Keyboards</span></a>
<ul class="toc">
<li>
<a href="#pointer-interaction"><span class="secno">6.1</span> <span class="content">Pointer interaction</span></a>
<ul class="toc">
<li>
<a href="#cursor"><span class="secno">6.1.1</span> <span class="content"><span class="property">cursor</span> property</span></a>
<ul class="toc">
<li><a href="#canvas_cursor"><span class="secno">6.1.1.1</span> <span class="content">Cursor of the canvas</span></a>
</ul>
</ul>
<li>
<a href="#insertion-caret"><span class="secno">6.2</span> <span class="content">Insertion caret</span></a>
<ul class="toc">
<li><a href="#caret-color"><span class="secno">6.2.1</span> <span class="content">Coloring the insertion caret: caret-color</span></a>
</ul>
<li>
<a href="#keyboard"><span class="secno">6.3</span> <span class="content">Keyboard control</span></a>
<ul class="toc">
<li>
<a href="#nav-dir"><span class="secno">6.3.1</span> <span class="content">Directional focus navigation: the <span class="property">nav-up</span>, <span class="property">nav-right</span>, <span class="property">nav-down</span>, <span class="property">nav-left</span> properties</span></a>
<ul class="toc">
<li><a href="#example-positioned-buttons"><span class="secno">6.3.1.1</span> <span class="content">Example: positioned buttons</span></a>
<li><a href="#example-moving-focus-to-inside-a-frame"><span class="secno">6.3.1.2</span> <span class="content">Example: moving focus to inside a frame</span></a>
</ul>
<li><a href="#input-method-editor"><span class="secno">6.3.2</span> <span class="content">Obsolete: the ime-mode property</span></a>
</ul>
</ul>
<li><a href="#acknowledgments"><span class="secno"></span> <span class="content">Appendix A. Acknowledgments</span></a>
<li><a href="#changes"><span class="secno"></span> <span class="content">Appendix B. Changes</span></a>
<li><a href="#security-privacy-considerations"><span class="secno"></span> <span class="content">Appendix C. Considerations for Security and Privacy</span></a>
<li><a href="#default-style-sheet"><span class="secno"></span> <span class="content">Appendix D. Default style sheet additions for HTML</span></a>
<li><a href="#test-suite"><span class="secno"></span> <span class="content">Appendix E: Test Suite</span></a>
<li>
<a href="#conformance"><span class="secno"></span> <span class="content"> Conformance</span></a>
<ul class="toc">
<li><a href="#conventions"><span class="secno"></span> <span class="content"> Document conventions</span></a>
<li><a href="#conformance-classes"><span class="secno"></span> <span class="content"> Conformance classes</span></a>
<li><a href="#partial"><span class="secno"></span> <span class="content"> Partial implementations</span></a>
<li><a href="#experimental"><span class="secno"></span> <span class="content"> Experimental implementations</span></a>
<li><a href="#testing"><span class="secno"></span> <span class="content"> Non-experimental implementations</span></a>
</ul>
<li>
<a href="#index"><span class="secno"></span> <span class="content">Index</span></a>
<ul class="toc">
<li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a>
<li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a>
</ul>
<li>
<a href="#references"><span class="secno"></span> <span class="content">References</span></a>
<ul class="toc">
<li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a>
<li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a>
</ul>
<li><a href="#property-index"><span class="secno"></span> <span class="content">Property Index</span></a>
</ul>
</div>
<main>
<p></p>
<h2 class="heading settled" data-level="1" id="intro"><span class="secno">1. </span><span class="content">Introduction</span><a class="self-link" href="#intro"></a></h2>
<p>This module describes CSS properties which enable authors
to style user interface related properties and values.</p>
<p><a href="http://www.w3.org/TR/REC-CSS1#anchor-pseudo-classes">Section 2.1 of CSS1</a> <a data-link-type="biblio" href="#biblio-css1">[CSS1]</a> and <a href="http://www.w3.org/TR/CSS2/ui.html">Chapter 18 of CSS2</a> <a data-link-type="biblio" href="#biblio-css2">[CSS2]</a> introduced several user interface related properties and values. <a href="http://www.w3.org/TR/2000/WD-css3-userint-20000216">User Interface for CSS3 (16 February 2000)</a> introduced several new user interface related features.</p>
<p>This Working Draft incorporates, extends, and supersedes them.</p>
<h3 class="heading settled" data-level="1.1" id="purpose"><span class="secno">1.1. </span><span class="content">Purpose</span><a class="self-link" href="#purpose"></a></h3>
<p>The purpose of this specification is to achieve the following objectives:</p>
<ul>
<li>Extend the user interface features in CSS2.1.
<li>Provide additional CSS mechanisms to augment or replace other
dynamic presentation related features in HTML.
<li>Introduce directional navigation properties to assist in the construction of
user interfaces which make use of a directional navigation model.
</ul>
<h2 class="heading settled" data-level="2" id="interaction"><span class="secno">2. </span><span class="content">Module Interactions</span><a class="self-link" href="#interaction"></a></h2>
<p>This document defines new features not present in earlier specifications.
In addition, it replaces and supersedes the following:</p>
<ul>
<li><a href="http://www.w3.org/TR/CSS21/ui.html#cursor-props">Section 18.1</a>, <a href="http://www.w3.org/TR/CSS21/ui.html#dynamic-outlines">section 18.4</a>,
and Information on the stacking of outlines defined in <a href="http://www.w3.org/TR/CSS21/zindex.html">Appendix E</a> of Cascading Style Sheets, level 2, revision 1 <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>
<li><a href="http://www.w3.org/TR/2000/WD-css3-userint-20000216">User Interface for CSS3 (16 February 2000)</a> <a data-link-type="biblio" href="#biblio-cssui">[CSSUI]</a>
</ul>
<h2 class="heading settled" data-level="3" id="box-model"><span class="secno">3. </span><span class="content">Box Model addition</span><a class="self-link" href="#box-model"></a></h2>
<h3 class="heading settled" data-level="3.1" id="box-sizing"><span class="secno">3.1. </span><span class="content"><a class="property" data-link-type="propdesc" href="#propdef-box-sizing">box-sizing</a> property</span><a class="self-link" href="#box-sizing"></a></h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-box-sizing">box-sizing<a class="self-link" href="#propdef-box-sizing"></a></dfn>
<tr>
<th>Value:
<td> content-box |
border-box
<tr>
<th>Initial:
<td>content-box
<tr>
<th>Applies to:
<td>all elements that accept width or height
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
<tr>
<th>Animatable:
<td>no
</table>
<dl>
<dt><dfn class="css" data-dfn-for="box-sizing" data-dfn-type="value" data-export="" id="valdef-box-sizing-content-box">content-box<a class="self-link" href="#valdef-box-sizing-content-box"></a></dfn>
<dd>This is the behavior of width and height as specified by CSS2.1.
The specified width and height (and respective min/max properties)
apply to the width and height respectively of the content box of the element.
The padding and border of the element are laid out
and drawn outside the specified width and height.
<dt><dfn class="css" data-dfn-for="box-sizing" data-dfn-type="value" data-export="" id="valdef-box-sizing-border-box">border-box<a class="self-link" href="#valdef-box-sizing-border-box"></a></dfn>
<dd>
Length and percentages values for width and height (and respective min/max properties)
on this element determine the border box of the element.
That is, any padding or border specified on the element
is laid out and drawn inside this specified width and height.
The content width and height are calculated
by subtracting the border and padding widths of the respective sides
from the specified <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width">width</a> and <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height">height</a> properties.
As the content width and height <a href="http://www.w3.org/TR/CSS21/visudet.html#the-width-property">cannot be negative</a> (<a data-link-type="biblio" href="#biblio-css21">[CSS21]</a>, section 10.2),
this computation is floored at 0.
Used values, as exposed for instance through getComputedStyle(), also refer to the border box.
<p class="note" role="note">Note: This is the behavior of width and height as commonly implemented
by legacy HTML user agents for replaced elements and input elements.</p>
</dl>
<p class="note" role="note">Note: In contrast to the length and percentage values,
the <span class="css">auto</span> value of the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width">width</a> and <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height">height</a> properties
(as well as other keyword values introduced by later specifications,
unless otherwise specified)
is not influenced by the <a class="property" data-link-type="propdesc" href="#propdef-box-sizing">box-sizing</a> property,
and always sets the size of the content box.</p>
<p>The following terms, whose definitions vary based on the computed value of <a class="property" data-link-type="propdesc" href="#propdef-box-sizing">box-sizing</a> are introduced:</p>
<table border="1">
<tbody>
<tr>
<th>
<th><a class="css" data-link-type="propdesc" href="#propdef-box-sizing">box-sizing: content-box</a>
<th><a class="css" data-link-type="propdesc" href="#propdef-box-sizing">box-sizing: border-box</a>
<tr>
<td><dfn data-dfn-type="dfn" data-noexport="" id="min-inner-width">min inner width<a class="self-link" href="#min-inner-width"></a></dfn>
<td><a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-min-width">min-width</a>
<td>max(0, <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-min-width">min-width</a> − <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-padding-left">padding-left</a> − <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-padding-right">padding-right</a> − <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-left-width">border-left-width</a> − <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-right-width">border-right-width</a>)
<tr>
<td><dfn data-dfn-type="dfn" data-noexport="" id="max-inner-width">max inner width<a class="self-link" href="#max-inner-width"></a></dfn>
<td><a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-max-width">max-width</a>
<td>max(0, <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-max-width">max-width</a> − <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-padding-left">padding-left</a> − <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-padding-right">padding-right</a> − <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-left-width">border-left-width</a> − <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-right-width">border-right-width</a>)
<tr>
<td><dfn data-dfn-type="dfn" data-noexport="" id="min-inner- C026 height">min inner height<a class="self-link" href="#min-inner-height"></a></dfn>
<td><a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-min-height">min-height</a>
<td>max(0, <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-min-height">min-height</a> − <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-padding-top">padding-top</a> − <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-padding-bottom">padding-bottom</a> − <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-top-width">border-top-width</a> − <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-bottom-width">border-bottom-width</a>)
<tr>
<td><dfn data-dfn-type="dfn" data-noexport="" id="max-inner-height">max inner height<a class="self-link" href="#max-inner-height"></a></dfn>
<td><a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-max-height">max-height</a>
<td>max(0, <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-max-height">max-height</a> − <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-padding-top">padding-top</a> − <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-padding-bottom">padding-bottom</a> − <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-top-width">border-top-width</a> − <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-bottom-width">border-bottom-width</a>)
</table>
<p>The <a href="http://www.w3.org/TR/CSS21/visudet.html">Visual formatting model details</a> of <a data-link-type="biblio" href="#biblio-css21">[CSS21]</a> are written assuming <a class="css" data-link-type="propdesc" href="#propdef-box-sizing">box-sizing: content-box</a>. The following disambiguations are made to clarify the behavior for all values of <a class="property" data-link-type="propdesc" href="#propdef-box-sizing">box-sizing</a>:</p>
<ol>
<li>In <a href="http://www.w3.org/TR/CSS21/visudet.html#blockwidth">10.3.3</a>, the second <q>width</q> in the following phrase is to be interpreted as <a data-link-type="dfn" href="https://drafts.csswg.org/css2/box.html#content-width">content width</a>: <q>If <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width">width</a> is not <span class="css">auto</span> and <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-left-width">border-left-width</a> + <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-padding-left">padding-left</a> + <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width">width</a> + [...]</q>
<li>In <a href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width">10.3.7</a>, <q>width</q> is to be interpreted as <a data-link-type="dfn" href="https://drafts.csswg.org/css2/box.html#content-width">content width</a> in the following equation: <q><a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/visuren.html#position-props">left</a> + <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-margin-left">margin-left</a> + <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-left-width">border-left-width</a> + <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-padding-left">padding-left</a> + <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width">width</a> + [...]</q>
<li>
In <a href="http://www.w3.org/TR/CSS21/visudet.html#min-max-widths">10.4</a>, <q>width</q>, <q>height</q>, <q>min-width</q>, <q>max-width</q>, <q>min-height</q> and <q>max-height</q> are respectively to be interpreted as <a data-link-type="dfn" href="https://drafts.csswg.org/css2/box.html#content-width">content width</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/css2/box.html#content-height">content height</a>, <a data-link-type="dfn" href="#min-inner-width">min inner width</a>, <a data-link-type="dfn" href="#max-inner-width">max inner width</a>, <a data-link-type="dfn" href="#min-inner-height">min inner height</a> and <a data-link-type="dfn" href="#max-inner-height">max inner height</a> in the following phrases:
<ol>
<li><q>The tentative used width is calculated [...]</q>
<li><q>If the tentative used width is greater than <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-max-width">max-width</a>, the rules above are applied again, but this time using the computed value of <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-max-width">max-width</a> as the computed value for <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width">width</a>.</q>
<li><q>If the resulting width is smaller than <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-min-width">min-width</a>, the rules above are applied again, but this time using the value of <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-min-width">min-width</a> as the computed value for <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width">width</a>.</q>
<li><q>Select from the table the resolved height and width values for the appropriate constraint violation. Take the max-width and max-height as max(min, max) so that min ≤ max holds true. In this table w and h stand for the results of the width and height computations [...]</q>
<li>All instances of these words in the table
<li><q>Then apply the rules under "Calculating widths and margins" above, as if <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width">width</a> were computed as this value.</q>
</ol>
<li>In <a href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height">10.6.4</a>, <q>height</q> is to be interpreted as <a data-link-type="dfn" href="https://drafts.csswg.org/css2/box.html#content-height">content height</a> in the following equation: <q><a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/visuren.html#position-props">top</a> + <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-margin-top">margin-top</a> + <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-top-width">border-top-width</a> + <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/box.html#propdef-padding-top">padding-top</a> + <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height">height</a> + [...]</q>
<li>
In <a href="http://www.w3.org/TR/CSS21/visudet.html#min-max-heights">10.7</a>, <q>width</q>, <q>height</q>, <q>min-height</q> and <q>max-height</q> are respectively to be interpreted as <a data-link-type="dfn" href="https://drafts.csswg.org/css2/box.html#content-width">content width</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/css2/box.html#content-height">content height</a>, <a data-link-type="dfn" href="#min-inner-height">min inner height</a> and <a data-link-type="dfn" href="#max-inner-height">max inner height</a> in the following phrases:
<ol>
<li><q>The tentative used height is calculated [...]</q>
<li><q>If this tentative height is greater than <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-max-height">max-height</a>, the rules above are applied again, but this time using the value of <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-max-height">max-height</a> as the computed value for <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height">height</a>.</q>
<li><q>If the resulting height is smaller than <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-min-height">min-height</a>, the rules above are applied again, but this time using the value of <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-min-height">min-height</a> as the computed value for <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height">height</a>.</q>
<li><q>[...] use the algorithm under Minimum and maximum widths above to find the used width and height. Then apply the rules under "Computing heights and margins" above, using the resulting width and height as if they were the computed values.</q>
</ol>
</ol>
<div class="example" id="example-ede4dfdf">
<a class="self-link" href="#example-ede4dfdf"></a>
<p style="display:none">Example(s): </p>
<h4 class="no-num no-toc heading settled" id="box-sizing-example"><span class="content">Using box-sizing to evenly share space</span><a class="self-link" href="#box-sizing-example"></a></h4>
<p>This example uses box-sizing to evenly horizontally split
two divs with fixed size borders inside a div container,
which would otherwise require additional markup.</p>
<p>sample CSS:</p>
<pre><code class="lang-css highlight"><span class="nt">div</span><span class="nc">.container</span> <span class="p">{</span>
<span class="k">width</span><span class="o">:</span><span class="m">38em</span><span class="p">;</span>
<span class="k">border</span><span class="o">:</span><span class="m">1em</span> <span class="k">solid</span> <span class="nb">black</span><span class="p">;</span>
<span class="p">}</span>
<span class="nt">div</span><span class="nc">.split</span> <span class="p">{</span>
<span class="n">box</span><span class="o">-</span><span class="n">sizing</span><span class="o">:</span><span class="k">border</span><span class="o">-</span><span class="n">box</span><span class="p">;</span>
<span class="k">width</span><span class="o">:</span><span class="m">50%</span><span class="p">;</span>
<span class="k">border</span><span class="o">:</span><span class="m">1em</span> <span class="nb">silver</span> <span class="k">ridge</span><span class="p">;</span>
<span class="k">float</span><span class="o">:</span><span class="k">left</span><span class="p">;</span>
<span class="p">}</span></code></pre>
<p>sample HTML fragment:</p>
<pre><code class="lang-markup highlight"><span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"container"</span><span class="nt">></span>
<span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"split"</span><span class="nt">></span>This div occupies the left half.<span class="nt">&lt;/div></span>
<span class="nt">&lt;div</span> <span class="na">class=</span><span class="s">"split"</span><span class="nt">></span>This div occupies the right half.<span class="nt">&lt;/div></span>
<span class="nt">&lt;/div></span></code></pre>
<p>demonstration of sample CSS and HTML:</p>
<div style="width:38em; border:1em solid black">
<div style="box-sizing:border-box; width:50%; border:1em silver ridge; float:left">This div should occupy the left half.</div>
<div style="box-sizing:border-box; width:50%; border:1em silver ridge; float:left">This div should occupy the right half.</div>
The two divs above should appear side by side, each (including borders) 50% of the content width of their container. If instead they are stacked one on top of the other then your browser does not support <a class="property" data-link-type="propdesc" href="#propdef-box-sizing">box-sizing</a>.
</div>
</div>
<h2 class="heading settled" data-level="4" id="outline-props"><span class="secno">4. </span><span class="content">Outline properties</span><a class="self-link" href="#outline-props"></a></h2>
<p>At times, style sheet authors may want to create outlines around
visual objects such as buttons, active form fields, image maps, etc.,
to make them stand out. Outlines differ from borders in the following
ways:</p>
<ol>
<li>Outlines do not take up space.
<li>Outlines may be non-rectangular.
<li>UAs often render outlines on elements in the :focus state.
</ol>
<p>The outline properties control the style of these dynamic outlines.</p>
<p>The stacking of the rendering of these outlines is explicitly left up to implementations to provide a better user experience per platform. This supersedes the stacking of outlines as defined in CSS 2.1.</p>
<p><strong class="advisement"> Keyboard users,
in particular people with disabilities
who may not be able to interact with the page in any other fashion,
depend on the outline being visible
on elements in the :focus state,
thus authors must not make the outline invisible on such elements
without making sure an alternative highlighting mechanism is provided. </strong></p>
<p>The rendering of applying transforms to outlines is left explicitly undefined in CSS3-UI.</p>
<h3 class="heading settled" data-level="4.1" id="outline"><span class="secno">4.1. </span><span class="content"><a class="property" data-link-type="propdesc" href="#propdef-outline">outline</a> property</span><a class="self-link" href="#outline"></a></h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-outline">outline<a class="self-link" href="#propdef-outline"></a></dfn>
<tr>
<th>Value:
<td> [ &lt;<a class="property" data-link-type="propdesc" href="#propdef-outline-color">outline-color</a>> || &lt;<a class="property" data-link-type="propdesc" href="#propdef-outline-style">outline-style</a>> ||
&lt;<a class="property" data-link-type="propdesc" href="#propdef-outline-width">outline-width</a>> ]
<tr>
<th>Initial:
<td>see individual properties
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>see individual properties
<tr>
<th>Animatable:
<td>see individual properties
</table>
<h3 class="heading settled" data-level="4.2" id="outline-width"><span class="secno">4.2. </span><span class="content"><a class="property" data-link-type="propdesc" href="#propdef-outline-width">outline-width</a> property</span><a class="self-link" href="#outline-width"></a></h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-outline-width">outline-width<a class="self-link" href="#propdef-outline-width"></a></dfn>
<tr>
<th>Value:
<td><a class="production" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-width">&lt;‘border-width’></a>
<tr>
<th>Initial:
<td>medium
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>absolute length; <span class="css">0</span> if the outline style is <span class="css">none</span>.
<tr>
<th>Animatable:
<td>as <a href="http://dev.w3.org/csswg/css3-transitions/#animtype-length">length</a>
</table>
<h3 class="heading settled" data-level="4.3" id="outline-style"><span class="secno">4.3. </span><span class="content"><a class="property" data-link-type="propdesc" href="#propdef-outline-style">outline-style</a> property</span><a class="self-link" href="#outline-style"></a></h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-outline-style">outline-style<a class="self-link" href="#propdef-outline-style"></a></dfn>
<tr>
<th>Value:
<td>auto | <a class="production" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-style">&lt;‘border-style’></a>
<tr>
<th>Initial:
<td>none
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value
<tr>
<th>Animatable:
<td>no
</table>
<h3 class="heading settled" data-level="4.4" id="outline-color"><span class="secno">4.4. </span><span class="content"><a class="property" data-link-type="propdesc" href="#propdef-outline-color">outline-color</a> property</span><a class="self-link" href="#outline-color"></a></h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-outline-color">outline-color<a class="self-link" href="#propdef-outline-color"></a></dfn>
<tr>
<th>Value:
<td><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-color-3/#valuea-def-color" title="Expands to: indigo | gold | firebrick | indianred | yellow | darkolivegreen | darkseagreen | slategrey | darkslategrey | greenyellow | mediumorchid | silver | papayawhip | dimgray | black | springgreen | crimson | lightsalmon | brown | turquoise | lightseagreen | cyan | transparent | skyblue | gray | darkturquoise | goldenrod | darkgreen | darkviolet | darkgray | lime | lightpink | teal | darkmagenta | lightgoldenrodyellow | lavender | yellowgreen | thistle | violet | navy | dimgrey | orchid | blue | ghostwhite | honeydew | cornflowerblue | maroon | purple | darkkhaki | mediumpurple | cornsilk | red | bisque | burlywood | darkcyan | khaki | wheat | deepskyblue | rebeccapurple | darkred | steelblue | aliceblue | lightslategrey | gainsboro | mediumturquoise | floralwhite | coral | aqua | mediumslateblue | lightcyan | darksalmon | beige | azure | lightsteelblue | oldlace | mediumvioletred | royalblue | olivedrab | sienna | lightcoral | orangered | navajowhite | slategray | palegreen | mistyrose | seashell | mediumspringgreen | fuchsia | chartreuse | blanchedalmond | peru | aquamarine | white | darkslategray | tomato | ivory | dodgerblue | currentcolor | lemonchiffon | lightgreen | orange | forestgreen | darkgrey | olive | mintcream | antiquewhite | cadetblue | moccasin | limegreen | saddlebrown | grey | darkslateblue | lightskyblue | deeppink | plum | lightgrey | darkgoldenrod | slateblue | sandybrown | magenta | tan | rosybrown | pink | lightblue | palevioletred | mediumseagreen | linen | darkorange | powderblue | seagreen | snow | mediumblue | midnightblue | paleturquoise | palegoldenrod | whitesmoke | darkorchid | salmon | lightslategray | lawngreen | chocolate | lightgray | hotpink | lightyellow | lavenderblush | darkblue | mediumaquamarine | green | blueviolet | peachpuff">&lt;color></a> | invert
<tr>
<th>Initial:
<td>invert
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>The computed value for <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css2/ui.html#value-def-invert">invert</a> is <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css2/ui.html#value-def-invert">invert</a>. For <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-color-3/#valuea-def-color" title="Expands to: indigo | gold | firebrick | indianred | yellow | darkolivegreen | darkseagreen | slategrey | darkslategrey | greenyellow | mediumorchid | silver | papayawhip | dimgray | black | springgreen | crimson | lightsalmon | brown | turquoise | lightseagreen | cyan | transparent | skyblue | gray | darkturquoise | goldenrod | darkgreen | darkviolet | darkgray | lime | lightpink | teal | darkmagenta | lightgoldenrodyellow | lavender | yellowgreen | thistle | violet | navy | dimgrey | orchid | blue | ghostwhite | honeydew | cornflowerblue | maroon | purple | darkkhaki | mediumpurple | cornsilk | red | bisque | burlywood | darkcyan | khaki | wheat | deepskyblue | rebeccapurple | darkred | steelblue | aliceblue | lightslategrey | gainsboro | mediumturquoise | floralwhite | coral | aqua | mediumslateblue | lightcyan | darksalmon | beige | azure | lightsteelblue | oldlace | mediumvioletred | royalblue | olivedrab | sienna | lightcoral | orangered | navajowhite | slategray | palegreen | mistyrose | seashell | mediumspringgreen | fuchsia | chartreuse | blanchedalmond | peru | aquamarine | white | darkslategray | tomato | ivory | dodgerblue | currentcolor | lemonchiffon | lightgreen | orange | forestgreen | darkgrey | olive | mintcream | antiquewhite | cadetblue | moccasin | limegreen | saddlebrown | grey | darkslateblue | lightskyblue | deeppink | plum | lightgrey | darkgoldenrod | slateblue | sandybrown | magenta | tan | rosybrown | pink | lightblue | palevioletred | mediumseagreen | linen | darkorange | powderblue | seagreen | snow | mediumblue | midnightblue | paleturquoise | palegoldenrod | whitesmoke | darkorchid | salmon | lightslategray | lawngreen | chocolate | lightgray | hotpink | lightyellow | lavenderblush | darkblue | mediumaquamarine | green | blueviolet | peachpuff">&lt;color></a> values, the computed value is as defined for the <a data-link-type="biblio" href="#biblio-css3color">[CSS3COLOR]</a> <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-color-3/#color0">color</a> property.
<tr>
<th>Animatable:
<td>as <a href="http://dev.w3.org/csswg/css3-transitions/#animtype-color">color</a>
</table>
<p>The outline created with the outline properties is drawn "over" a box,
i.e., the outline is always on top,
and doesn’t influence the position or size of the box,
or of any other boxes.
Therefore, displaying or suppressing outlines does not cause reflow.</p>
<p>Outlines may be non-rectangular.
For example, if the element is broken across several lines,
the outline should be an outline or minimum set of outlines
that encloses all the element’s boxes.</p>
<p>Each part of the outline should be fully connected
rather than open on some sides
(as borders on inline elements are when lines are broken).</p>
<p>The parts of the outline are not required to be rectangular.
To the extent that the outline follows the <a data-link-type="dfn" href="http://www.w3.org/TR/CSS21/box.html#border-edge">border edge</a>,
it should follow the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-radius">border-radius</a> curve.</p>
<p>The position of the outline may be affected by descendant boxes.</p>
<p>User agents should use an algorithm for determining
the outline that encloses a region appropriate
for conveying the concept of focus to the user.</p>
<p class="note" role="note">Note: This specification does not define the exact position or shape of the outline, but it is typically drawn immediately outside the border box.</p>
<p>The <a class="property" data-link-type="propdesc" href="#propdef-outline-width">outline-width</a> property accepts
the same values as <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-width">border-width</a> (<a data-link-type="biblio" href="#biblio-css3bg">[CSS3BG]</a>, <a href="http://www.w3.org/TR/css3-background/#the-border-width">Section 4.3</a>).</p>
<p>The <a class="property" data-link-type="propdesc" href="#propdef-outline-style">outline-style</a> property accepts
the same values as <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-backgrounds-3/#border-style">border-style</a> (<a data-link-type="biblio" href="#biblio-css3bg">[CSS3BG]</a>, <a href="http://www.w3.org/TR/css3-background/#the-border-style">Section 4.2</a>),
except that <span class="css">hidden</span> is not a legal outline style.
In addition, in CSS3, <a class="property" data-link-type="propdesc" href="#propdef-outline-style">outline-style</a> accepts the value <span class="css">auto</span>.
The <span class="css">auto</span> value permits the user agent
to render a custom outline style,
typically a style which is either a user interface default for the platform,
or perhaps a style that is richer
than can be described in detail in CSS,
e.g. a rounded edge outline with semi-translucent outer pixels
that appears to glow.
As such, this specification does not define how the <a class="property" data-link-type="propdesc" href="#propdef-outline-color">outline-color</a> is incorporated or used (if at all) when rendering <span class="css">auto</span> style outlines.
User agents may treat <span class="css">auto</span> as <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-backgrounds-3/#solid">solid</a>.</p>
<p>The <a class="property" data-link-type="propdesc" href="#propdef-outline-color">outline-color</a> property
accepts all colors, as well as the keyword <dfn data-dfn-type="dfn" data-noexport="" id="invert">invert<a class="self-link" href="#invert"></a></dfn>. <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css2/ui.html#value-def-invert">Invert</a> is expected to perform a color inversion on the pixels on the screen.
This is a common trick to ensure the focus border is visible,
regardless of color background.</p>
<p>Conformant UAs may ignore the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css2/ui.html#value-def-invert">invert</a> value
on platforms that do not support color inversion of the pixels on the screen.</p>
<p>If the UA does not support the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css2/ui.html#value-def-invert">invert</a> value
then it must reject that value at parse-time, and
the initial value of the <a class="property" data-link-type="propdesc" href="#propdef-outline-color">outline-color</a> property
is the <span class="css">currentColor</span> <a data-link-type="biblio" href="#biblio-css3color">[CSS3COLOR]</a> keyword.</p>
<p>The <a class="property" data-link-type="propdesc" href="#propdef-outline">outline</a> property is a shorthand property,
and sets all three of <a class="property" data-link-type="propdesc" href="#propdef-outline-style">outline-style</a>, <a class="property" data-link-type="propdesc" href="#propdef-outline-width">outline-width</a>,
and <a class="property" data-link-type="propdesc" href="#propdef-outline-color">outline-color</a>.</p>
<p class="note" role="note">Note: The outline is the same on all sides.
In contrast to borders,
there are no <a class="property" data-link-type="propdesc">outline-top</a> or <a class="property" data-link-type="propdesc">outline-left</a> etc. properties.</p>
<p>This specification does not define how multiple overlapping outlines are drawn,
or how outlines are drawn for boxes that are partially obscured behind other elements.</p>
<div class="example" id="example-bcd0e0d3">
<a class="self-link" href="#example-bcd0e0d3"></a>
<p style="display:none">Example(s): </p>
<p>Here’s an example of drawing a thick outline around a BUTTON element:</p>
<pre><code class="lang-css highlight"><span class="nt">button</span> <span class="p">{</span> <span class="k">outline</span><span class="o">:</span> <span class="k">thick</span> <span class="k">solid</span> <span class="p">}</span></code></pre>
</div>
<p>Graphical user interfaces may use outlines around elements
to tell the user which element on the page has the focus.
These outlines are in addition to any borders,
and switching outlines on and off should not cause the document to reflow.
The focus is the subject of user interaction in a document
(e.g. for entering text or selecting a button).</p>
<div class="example" id="example-4b3084c1">
<a class="self-link" href="#example-4b3084c1"></a>
<p style="display:none">Example(s): </p>
<p>For example, to draw a thick black line around an element when it has the focus,
and a thick red line when it is active,
the following rules can be used:</p>
<pre><code class="lang-css highlight"><span class="nd">:focus</span> <span class="p">{</span> <span class="k">outline</span><span class="o">:</span> <span class="k">thick</span> <span class="k">solid</span> <span class="nb">black</span> <span class="p">}</span>
<span class="nd">:active</span> <span class="p">{</span> <span class="k">outline</span><span class="o">:</span> <span class="k">thick</span> <span class="k">solid</span> <span class="nb">red</span> <span class="p">}</span></code></pre>
</div>
<p class="note" role="note">Note: Since the outline does not affect formatting
(i.e., no space is left for it in the box model),
it may well overlap other elements on the page.</p>
<h3 class="heading settled" data-level="4.5" id="outline-offset"><span class="secno">4.5. </span><span class="content"><a class="property" data-link-type="propdesc" href="#propdef-outline-offset">outline-offset</a> property</span><a class="self-link" href="#outline-offset"></a></h3>
<p>By default, the outline is drawn starting just outside the <a data-link-type="dfn" href="http://www.w3.org/TR/CSS21/box.html#border-edge">border edge</a>.
However, it is possible to offset the outline and draw it beyond the <a data-link-type="dfn" href="http://www.w3.org/TR/CSS21/box.html#border-edge">border edge</a>.</p>
<table class="propdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-outline-offset">outline-offset<a class="self-link" href="#propdef-outline-offset"></a></dfn>
<tr>
<th>Value:
<td><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value">&lt;length></a>
<tr>
<th>Initial:
<td>0
<tr>
<th>Applies to:
<td>all elements
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#length-value">&lt;length></a> value in absolute units (px or physical).
<tr>
<th>Animatable:
<td>as <a href="http://dev.w3.org/csswg/css3-transitions/#animtype-length">length</a>
</table>
<p>If the computed value of <a class="property" data-link-type="propdesc" href="#propdef-outline-offset">outline-offset</a> is anything other than 0,
then the outline is outset from the <a data-link-type="dfn" href="http://www.w3.org/TR/CSS21/box.html#border-edge">border edge</a> by that amount.</p>
<div class="example" id="example-8c7e0106">
<a class="self-link" href="#example-8c7e0106"></a>
<p style="display:none">Example(s): </p>
<p>For example,
to leave 2 pixels of space between a focus outline
and the element that has the focus or is active,
the following rule can be used:</p>
<pre><code class="lang-css highlight"><span class="nd">:focus</span><span class="o">,</span><span class="nd">:active</span> <span class="p">{</span> <span class="k">outline</span><span class="o">-</span><span class="n">offset</span><span class="o">:</span> <span class="m">2px</span> <span class="p">}</span></code></pre>
</div>
<p id="negative-offset">Negative values must cause the outline
to shrink into the border box.
Both the height and the width of outside of the shape
drawn by the outline must not become smaller
than twice the computed value of the outline-width property,
to make sure that an outline can be rendered
even with large negative values.
User Agents must apply this constraint
independently in each dimension.
If the outline is drawn as multiple disconnected shapes,
this constraint applies to each shape separately. </p>
<p class="note" role="note">Note: Negative value constraints are an at risk feature due to <a href="https://lists.w3.org/Archives/Public/www-style/2014Dec/0033.html">interoperability problems</a>, and thus might be dropped from a must to a should.</p>
<h2 class="heading settled" data-level="5" id="resizing-and-overflow"><span class="secno">5. </span><span class="content">Resizing &amp; Overflow</span><a class="self-link" href="#resizing-and-overflow"></a></h2>
<p>CSS2.1 provides a mechanism for controlling the appearance of a scrolling mechanism
(e.g. scrollbars)
on block container elements.
This specification adds to that a mechanism for controlling
user resizability of elements as well as the ability to specify text overflow behavior.</p>
<h3 class="heading settled" data-level="5.1" id="resize"><span class="secno">5.1. </span><span class="content"><a class="property" data-link-type="propdesc" href="#propdef-resize">resize</a> property</span><a class="self-link" href="#resize"></a></h3>
<p>The <a class="property" data-link-type="propdesc" href="#propdef-resize">resize</a> property allows the author
to specify whether or not an element is resizable by the user,
and if so, along which axis/axes.</p>
<table class="propdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-resize">resize<a class="self-link" href="#propdef-resize"></a></dfn>
<tr>
<th>Value:
<td>none | both | horizontal | vertical
<tr>
<th>Initial:
<td>none
<tr>
<th>Applies to:
<td>elements with <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/visufx.html#propdef-overflow">overflow</a> other than visible,
and optionally replaced elements representing images or videos, and iframes
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>specified value.
<tr>
<th>Animatable:
<td>no
</table>
<dl>
<dt>none
<dd>The UA does not present a resizing mechanism on the element,
and the user is given no direct manipulation mechanism to resize the element.
<dt>both
<dd>The UA presents a bidirectional resizing mechanism
to allow the user to adjust both the height and the width of the element.
<dt>horizontal
<dd>The UA presents a unidirectional horizontal resizing mechanism
to allow the user to adjust only the width of the element.
<dt>vertical
<dd>The UA presents a unidirectional vertical resizing mechanism
to allow the user to adjust only the height of the element.
</dl>
<p>Currently it is possible to control the appearance of the scrolling mechanism (if any)
on an element using the <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/visufx.html#propdef-overflow">overflow</a> property
(e.g. <code class="lang-css highlight"><span class="nt">overflow</span><span class="o">:</span> <span class="nt">scroll</span></code> vs. <code class="lang-css highlight"><span class="nt">overflow</span><span class="o">:</span> <span class="nt">hidden</span></code> etc.).
The purpose of the <a class="property" data-link-type="propdesc" href="#propdef-resize">resize</a> property
is to allow control over the appearance and function of the resizing mechanism
(e.g. a resize box or widget) on the element.</p>
<p class="note" role="note">Note: The resizing mechanism is NOT the same as the scrolling mechanism.
The scrolling mechanism allows the user
to determine which portion of the contents of an element is shown.
The resizing mechanism allows the user
to determine the size of the element.</p>
<p>The <a class="property" data-link-type="propdesc" href="#propdef-resize">resize</a> property applies to elements
whose computed <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/visufx.html#propdef-overflow">overflow</a> value
is something other than <a class="css" data-link-type="maybe" href="http://www.w3.org/TR/CSS21/visufx.html#propdef-overflow">visible</a>.
UAs may also apply it,
regardless of the value of the <a class="css" data-link-type="maybe" href="https://drafts.csswg.org/css-overflow-3/#valdef-continue-overflow">overflow</a> property,
to:</p>
<ul>
<li>Replaced elements representing images or videos, such as <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element">img</a></code>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/embedded-content.html#video">video</a></code>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/embedded-content.html#the-picture-element">picture</a></code>, <code><a data-link-type="element" href="https://svgwg.org/svg2-draft/struct.html#NewDocument">svg</a></code>, <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/embedded-content.html#the-object-element">object</a></code>, or <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/scripting.html#canvas">canvas</a></code>.
<li>The <code><a data-link-type="element" href="https://html.spec.whatwg.org/multipage/embedded-content.html#the-iframe-element">iframe</a></code> element.
</ul>
<p>The effect of the <a class="property" data-link-type="propdesc" href="#propdef-resize">resize</a> property on generated content is undefined. Implementations should not apply the <a class="property" data-link-type="propdesc" href="#propdef-resize">resize</a> property to generated content.</p>
<p class="note" role="note">Note: the <a class="property" data-link-type="propdesc" href="#propdef-resize">resize</a> property may apply to generated content in the future if there is implementation of <a href="http://dev.w3.org/csswg/css-pseudo/#CSSPseudoElement-interface">Interface CSSPseudoElement</a>.</p>
<p>When an element is resized by the user,
the user agent sets
the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width">width</a> and <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height">height</a> properties
to px unit length values of the size indicated by the user,
in the element’s <a href="http://www.w3.org/TR/css-style-attr/#style-attribute">style attribute</a> DOM,
replacing existing property declaration(s), if any,
without <span class="css">!important</span>, if any.</p>
<p>If an element is resized in only one dimension,
only the corresponding property is set, not both.</p>
<p>The precise direction of resizing
(i.e. altering the top left of the element or altering the bottom right)
may depend on a number of CSS layout factors
including whether the element is absolutely positioned,
whether it is positioned using the <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/visuren.html#position-props">right</a> and <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/visuren.html#position-props">bottom</a> properties,
whether the language of the element is right-to-left etc.
The UA should consider the direction of resizing
(as determined by CSS layout),
as well as platform conventions and constraints when deciding
how to convey the resizing mechanism to the user.</p>
<p>The user agent must allow the user to resize the element
with no other constraints than what is imposed by <a class="property" data- B295 link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-min-width">min-width</a>, <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-max-width">max-width</a>, <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-min-height">min-height</a>, and <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-max-height">max-height</a>.
(The "must" is <a href="https://wiki.csswg.org/spec/css3-ui#issue-53">at risk</a> since <a href="http://lists.w3.org/Archives/Public/www-style/2014Dec/0063.html">only Firefox currently supports this</a>, and may be downgraded to a "should".)</p>
<p class="note" role="note">Note: There may be situations where user attempts to resize an element
appear to be overriden or ignored, e.g. because of <span class="css">!important</span> cascading declarations that supersede
that element’s <a href="http://www.w3.org/TR/css-style-attr/#style-attribute">style attribute</a> <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-width">width</a> and <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css2/visudet.html#propdef-height">height</a> properties in the DOM.</p>
<p>Changes to the computed value of an element’s <a class="property" data-link-type="propdesc" href="#propdef-resize">resize</a> property
do not reset changes to the <a href="http://www.w3.org/TR/css-style-attr/#style-attribute">style attribute</a> made due to
user resizing of that element.</p>
<div class="example" id="example-0ff410a0">
<a class="self-link" href="#example-0ff410a0"></a>
<p style="display:none">Example(s): </p>
<p>For example,
to make iframes scrollable <em>and</em> resizable,
the following rule can be used:</p>
<pre><code class="lang-css highlight"><span class="nt">iframe</span><span class="o">,</span><span class="nt">object</span><span class="o">[</span><span class="nt">type</span><span class="o">^=</span><span class="s2">"text/"</span><span class="o">],</span>
<span class="nt">object</span><span class="o">[</span><span class="nt">type</span><span class="o">$=</span><span class="s2">"+xml"</span><span class="o">],</span><span class="nt">object</span><span class="o">[</span><span class="nt">type</span><span class="o">=</span><span class="s2">"application/xml"</span><span class="o">]</span>
<span class="p">{</span>
<span class="k">overflow</span><span class="o">:</span><span class="k">auto</span><span class="p">;</span>
<span class="n">resize</span><span class="o">:</span><span class="k">both</span><span class="p">;</span>
<span class="p">}</span></code></pre>
</div>
<p></p>
<h3 class="heading settled" data-level="5.2" id="text-overflow"><span class="secno">5.2. </span><span class="content"> Overflow Ellipsis: the <a class="property" data-link-type="propdesc" href="#propdef-text-overflow">text-overflow</a> property</span><a class="self-link" href="#text-overflow"></a></h3>
<table class="propdef">
<tbody>
<tr>
<th>Name:
<td><dfn class="css" data-dfn-type="property" data-export="" id="propdef-text-overflow">text-overflow<a class="self-link" href="#propdef-text-overflow"></a></dfn>
<tr>
<th>Value:
<td> [
clip |
ellipsis | <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#string-value">&lt;string></a> ]{1,2}
<tr>
<th>Initial:
<td>clip
<tr>
<th>Applies to:
<td>block containers
<tr>
<th>Inherited:
<td>no
<tr>
<th>Percentages:
<td>N/A
<tr>
<th>Media:
<td>visual
<tr>
<th>Computed value:
<td>as specified
<tr>
<th>Animatable:
<td>no
</table>
<p>This property specifies rendering when inline content overflows
its line box edge
in the inline progression direction of its block container element ("the block")
that has <a class="property" data-link-type="propdesc" href="http://www.w3.org/TR/CSS21/visufx.html#propdef-overflow">overflow</a> other than <a class="css" data-link-type="maybe" href="http://www.w3.org/TR/CSS21/visufx.html#propdef-overflow">visible</a>.</p>
<p>Text can overflow for example when it is prevented from wrapping
(e.g. due to <code class="lang-css highlight"><span class="nt">white-space</span><span class="o">:</span> <span class="nt">nowrap</span></code> or a single word is too long to fit).
Values have the following meanings:</p>
<dl class="valuedef">
<dt id="overflow-clip"><a class="self-link" href="#overflow-clip"></a><dfn data-dfn-for="overflow" data-dfn-type="dfn" data-noexport="" id="clip">clip<a class="self-link" href="#clip"></a></dfn>
<dd>Clip inline content that overflows its block container element. Characters may be only partially rendered.
<dt id="overflow-ellipsis"><a class="self-link" href="#overflow-ellipsis"></a><dfn data-dfn-for="overflow" data-dfn-type="dfn" data-noexport="" id="ellipsis">ellipsis<a class="self-link" href="#ellipsis"></a></dfn>
<dd> Render an ellipsis character (U+2026)
to represent clipped inline content.
Implementations may substitute a more language, script, or writing-mode appropriate
ellipsis character,
or three dots "..." if the ellipsis character is unavailable.
<dt id="overflow-string"><a class="self-link" href="#overflow-string"></a><a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#string-value">&lt;string></a>
<dd> Render the given string to represent clipped inline content.
The given string is treated as an independent paragraph
for bidi purposes.
</dl>
<p class="note" role="note">Note: The <a class="production css" data-link-type="type" href="https://drafts.csswg.org/css-values-3/#string-value">&lt;string></a> value, and the 2-value syntax "{1,2}"
and functionality are all at risk.</p>
<p>The term "character" is used in this property definition
for better readability and means "grapheme cluster" <a data-link-type="biblio" href="#biblio-uax29">[UAX29]</a> for implementation purposes.</p>
<p>If there is one value,
it applies only to the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-3/#end">end</a> line box edge.
If there are two values,
the first value applies to the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-3/#line-left">line-left</a> edge,
and the second value applies to the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-3/#line-right">line-right</a> edge.
The terms <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-3/#end">end</a>, <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-3/#line-left">line-left</a> and <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-3/#line-right">line-right</a> are defined in <a data-link-type="biblio" href="#biblio-css3-writing-modes">[CSS3-WRITING-MODES]</a>.</p>
<p class="note" role="note">Note: the use of <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-3/#line-left">line-left</a> and <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-3/#line-right">line-right</a> rather than <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-3/#start">start</a> and <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-3/#end">end</a> when there are two values is intentional,
to facilitate the use of directional characters such as arrows.</p>
<p>For the ellipsis
and string values,
implementations must hide characters and <a href="http://www.w3.org/TR/CSS21/visuren.html#inline-boxes"> atomic inline-level elements</a> at the applicable edge(s) of the line as necessary to fit the ellipsis/string.
Place the ellipsis/string immediately adjacent
to the applicable edge(s) of the remaining inline content.
The first character or <a href="http://www.w3.org/TR/CSS21/visuren.html#inline-boxes"> atomic inline-level element</a> on a line
must be clipped rather than ellipsed.</p>
<h4 class="no-num no-toc heading settled" id="ellipsing-details"><span class="content">ellipsing details</span><a class="self-link" href="#ellipsing-details"></a></h4>
<ul>
<li> Ellipsing only affects rendering and must not affect layout
nor dispatching of pointer events.
<li> The ellipsis is styled and baseline-aligned according to
the block.
<li> Ellipsing occurs after relative positioning and other graphical transformations.
<li> If there is insufficient space for the ellipsis,
then clip the rendering of the ellipsis itself
(on the same side that neutral characters on the line
would have otherwise been clipped with the <span class="css">text-overflow:clip</span> value).
</ul>
<h4 class="no-num no-toc heading settled" id="ellipsis-interaction"><span class="content">user interaction with ellipsis</span><a class="self-link" href="#ellipsis-interaction"></a></h4>
<ul>
<li>When the user is interacting with content
(e.g. editing, selecting, scrolling),
the user agent may treat text-overflow <span class="css">ellipsis</span> or string values as <span class="css">text-overflow:clip</span>.
<li>Selecting the ellipsis should select the ellipsed text.
If all of the ellipsed text is selected,
UAs should show selection of the ellipsis.
Behavior of partially-selected ellipsed text is up to the UA.
</ul>
<div class="example" id="example-bff7c1fa">
<a class="self-link" href="#example-bff7c1fa"></a>
<p style="display:none">Example(s): </p>
<h4 class="no-num no-toc heading settled" id="text-overflow-examples"><span class="content">text-overflow examples</span><a class="self-link" href="#text-overflow-examples"></a></h4>
<p>These examples demonstrate setting the text-overflow of a block container element
that has text which overflows its dimensions:</p>
<p>sample CSS for a div:</p>
<pre><code class="lang-css highlight"><span class="nt">div</span> <span class="p">{</span> <span class="k">font-family</span><span class="o">:</span><span class="n">Helvetica</span><span class="o">,</span><span class="k">sans-serif</span><span class="p">;</span> <span class="k">line-height</span><span class="o">:</span><span class="m">1</span><span class="o">.</span><span class="m">1</span><span class="p">;</span>
<span class="k">width</span><span class="o">:</span><span class="m">3.1em</span><span class="p">;</span> <span class="k">padding</span><span class="o">:.</span><span class="m">2em</span><span class="p">;</span> <span class="k">border</span><span class="o">:</span><span class="k">solid</span> <span class="m">.1em</span> <span class="nb">black</span><span class="p">;</span> <span class="k">margin</span><span class="o">:</span><span class="m">1em</span> <span class="m">0</span><span class="p">;</span>
<span class="p">}</span></code></pre>
<p>sample HTML fragments, renderings, and your browser:</p>
<table id="awesome-table" style="color:#000;background:#fff">
<tbody>
<tr>
<th>HTML
<th>sample rendering
<th>your browser
<tr>
<td>
<pre><code class="lang-markup highlight"><span class="nt">&lt;div></span>
CSS IS AWESOME, YES
<span class="nt">&lt;/div></span></code></pre>
<td>
<object data="images/cssisawesome.png" type="image/png"> First, a box with text drawing outside of it. </object>
<td>
<div style="width:3.1em; border:solid .1em black; margin:1em 0; padding:.2em; font-family:Helvetica,sans-serif; line-height:1.1;">CSS IS AWESOME, YES</div>
<tr>
<td>
<pre><code class="lang-markup highlight"><span class="nt">&lt;div</span> <span class="na">style=</span><span class="s">"text-overflow:clip; overflow:hidden"</span><span class="nt">></span>
CSS IS AWESOME, YES
<span class="nt">&lt;/div></span></code></pre>
<td>
<object data="images/cssisaweso.png" type="image/png"> Second, a similar box with the text clipped outside the box. </object>
<td>
<div style="width:3.1em; border:solid .1em black; margin:1em 0; padding:.2em; font-family:Helvetica,sans-serif; line-height:1.1; overflow:hidden;text-overflow:clip;">CSS IS AWESOME, YES</div>
<tr>
<td>
<pre><code class="lang-markup highlight"><span class="nt">&lt;div</span> <span class="na">style=</span><span class="s">"text-overflow:ellipsis; overflow:hidden"</span><span class="nt">></span>
CSS IS AWESOME, YES
<span class="nt">&lt;/div></span></code></pre>
<td>
<object data="images/cssisaw.png" type="image/png"> Third, a similar box with an ellipsis representing the clipped text. </object>
<td>
<div style="width:3.1em; border:solid .1em black; margin:1em 0; padding:.2em; font-family:Helvetica,sans-serif; line-height:1.1; overflow:hidden;text-overflow:ellipsis;">CSS IS AWESOME, YES</div>
<tr>
<td>
<pre><code class="lang-markup highlight"><span class="nt">&lt;div</span> <span class="na">style=</span><span class="s">"text-overflow:ellipsis; overflow:hidden"</span><span class="nt">></span>
NESTED
<span class="nt">&lt;p></span>PARAGRAPH<span class="nt">&lt;/p></span>
WON’T ELLIPSE.
<span class="nt">&lt;/div></span></code></pre>
<td>
<object data="images/nes.png" type="image/png"> Fourth, a box with a nested paragraph demonstrating anonymous block boxes equivalency and non-inheritance into a nested element. </object>
<td>
<div style="width:3.1em; border:solid .1em black; margin:1em 0; padding:.2em; font-family:Helvetica,sans-serif; line-height:1.1; overflow:hidden;text-overflow:ellipsis;">
NESTED
<p>PARAGRAPH</p>
WON’T ELLIPSE.
</div>
</table>
</div>
<p class="note" role="note">Note: the side of the line that the ellipsis is placed depends on the <a class="property" data-link-type="propdesc" href="https://drafts.csswg.org/css-writing-modes-3/#propdef-direction">direction</a> of the block.
E.g. an overflow hidden right-to-left
(<code class="lang-css highlight"><span class="nt">direction</span><span class="o">:</span> <span class="nt">rtl</span></code>)
block clips inline content on the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-3/#left">left</a> side,
thus would place a text-overflow ellipsis on the <a data-link-type="dfn" href="https://drafts.csswg.org/css-writing-modes-3/#left">left</a> to represent that clipped content.</p>
<h4 class="no-num no-toc heading settled" id="ellipsis-scrolling"><span class="content">ellipsis interaction with scrolling interfaces</span><a class="self-link" href="#ellipsis-scrolling"></a></h4>
<p>This section applies to elements with text-overflow other than <span class="css">text-overflow:clip</span> (non-clip text-overflow)
and overflow:scroll.</p>
<p>When an element with non-clip text-overflow has overflow of scroll