CSS Basic User Interface Module Level 3 (CSS3 UI)

ED: http://dev.w3.org/csswg/css-ui/
TR: http://www.w3.org/TR/css3-ui/
Previous Version: http://www.w3.org/TR/2012/WD-css3-ui-20120117/
Shortname: css-ui
Level: 3
Group: csswg
!Issue Tracking: http://wiki.csswg.org/spec/css3-ui
Status: ED
Editor: Tantek Çelik, Mozilla http://www.mozilla.org, tantek@cs.stanford.edu, http://tantek.com

Abstract: This specification describes user interface related selectors,
          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 selectors,
          properties and values of CSS level 2 revision 1 and Selectors specifications.
          It uses various selectors,
          properties and values to style basic user interface elements in a document.
Deadline: 2012-02-14
Link Defaults: css-color-3 (property) color
Link Defaults: selectors-4 (selector) :indeterminate
Link Defaults: css21 (property) border-width
Link Defaults: css21 (property) border-style
Ignored Terms: outline-top
Ignored Terms: outline-left
At Risk: ::value ::choices pseudo-elements
At Risk: 'box-sizing' property value: padding-box
At Risk: 'caret-color' property
At Risk: 'ime-mode' property
At Risk: 'text-overflow' property value: <string>
At Risk: 'text-overflow' property 2-value syntax and definition

Introduction

This module describes selectors and CSS properties which enable authors to style user interface related states, element fragments, properties and values. Section 2.1 of CSS1 [[CSS1]] and Chapter 18 of CSS2 [[CSS2]] introduced several user interface related pseudo-classes, properties and values. Section 6.6.4 of Selectors [[!SELECT]] also describes several additional user interface related pseudo-classes (and one pseudo-element). User Interface for CSS3 (16 February 2000) introduced several new user interface related features. This Working Draft incorporates and extends them to provide the ability, through CSS, to style elements based upon additional user interface states, to style fragments of user interface elements, and to alter the dynamic presentation of elements in ways previously only available through specific HTML elements and attributes.

Purpose

The purpose of this specification is to achieve the following objectives:

Module Interactions

This document defines new features not present in earlier specifications. In addition, it replaces and supersedes the following:

User Interface Selectors

User interface element fragments: pseudo-elements

This specification introduces two new pseudo-elements to provide access to additional user interface element fragments. Note: The ::value and ::choices pseudo-elements are at risk.

::value

A form element may contain both a label for its data value, and the data value itself. For such elements, the ::value pseudo-element selects the representation of just the data value itself, in order to style its appearance. The ''::value'' pseudo-element is similar to an inline-level element, but with certain restrictions. The following properties apply to ''::value'' pseudo-element: font properties, color property, background properties, 'word-spacing', 'letter-spacing', 'text-decoration', 'vertical-align', 'text-transform', 'line-height'. UAs may apply other properties as well.

::choices

Similarly, a form element which represents a list of options may contain both a label for the list, and the list of choices itself. For such elements, the ''::choices'' pseudo-element selects the representation of just the list of choices themselves, in order to style their appearance. A list of radio buttons can also be selected with the ''::choices'' pseudo-element, and the currently chosen radio button can be selected with the ''::value'' pseudo-element.

Box Model addition

'box-sizing' property

Name:box-sizing
Value: content-box | padding-box | border-box
Initial:content-box
Applies to:all elements that accept width or height
Inherited:no
Percentages:N/A
Media:visual
Computed value:specified value
Animatable:no
content-box
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.
padding-box
The specified width and height (and respective min/max properties) on this element determine the padding box of the element. That is, any padding 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 padding widths of the respective sides from the specified 'width' and 'height' properties. As the content width and height cannot be negative ([[!CSS21]], section 10.2), this computation is floored at 0.
border-box
The specified 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 'width' and 'height' properties. As the content width and height cannot be negative ([[!CSS21]], section 10.2), this computation is floored at 0. Note: This is the behavior of width and height as commonly implemented by legacy HTML user agents for replaced elements and input elements.

Example(s):

Using box-sizing to evenly share space

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. sample CSS:

div.container {
	width:38em;
	border:1em solid black;
}

div.split {
	box-sizing:border-box;
	width:50%;
	border:1em silver ridge;
	float:left;
}
sample HTML fragment:

<div class="container">
<div class="split">This div occupies the left half.</div>
<div class="split">This div occupies the right half.</div>
</div>
demonstration of sample CSS and HTML:
This div should occupy the left half.
This div should occupy the right half.
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 'box-sizing'.
Note: The ''padding-box'' value is at risk.

Outline properties

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:
  1. Outlines do not take up space.
  2. Outlines may be non-rectangular.
  3. UAs often render outlines on elements in the :focus state.
The outline properties control the style of these dynamic outlines. Keyboard users depend on outline on elements in the :focus state for interaction with the page, thus authors must not make the outline invisible on such elements without making sure an alternative highlighting mechanism is provided.

'outline' property

Name:outline
Value: [ <'outline-color'> || <'outline-style'> || <'outline-width'> ]
Initial:see individual properties
Applies to:all elements
Inherited:no
Percentages:N/A
Media:visual
Computed value:see individual properties
Animatable:see individual properties

'outline-width' property

Name:outline-width
Value:<<'border-width'>>
Initial:medium
Applies to:all elements
Inherited:no
Percentages:N/A
Media:visual
Computed value:absolute length; ''0'' if the outline style is ''none''.
Animatable:as length

'outline-style' property

Name:outline-style
Value:auto | <<'border-style'>>
Initial:none
Applies to:all elements
Inherited:no
Percentages:N/A
Media:visual
Computed value:specified value
Animatable:no

'outline-color' property

Name:outline-color
Value:<> | invert
Initial:invert
Applies to:all elements
Inherited:no
Percentages:N/A
Media:visual
Computed value:The computed value for ''invert'' is ''invert''. For <color> values, the computed value is as defined for the [[!CSS3COLOR]] 'color' property.
Animatable:as color
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. 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. 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). The parts of the outline are not required to be rectangular. To the extent that the outline follows the border edge, it should follow the border-radius curve. The position of the outline may be affected by descendant boxes. User agents should use an algorithm for determining the outline that encloses a region appropriate for conveying the concept of focus to the user. Note: This specification does not define the exact position or shape of the outline, but it is typically drawn immediately outside the border box. The 'outline-width' property accepts the same values as 'border-width' ([[!CSS3BG]], Section 4.3). The 'outline-style' property accepts the same values as 'border-style' ([[!CSS3BG]], Section 4.2), except that ''hidden'' is not a legal outline style. In addition, in CSS3, 'outline-style' accepts the value ''auto''. The ''auto'' 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 'outline-color' is incorporated or used (if at all) when rendering ''auto'' style outlines. User agents may treat ''auto'' as ''solid''. The 'outline-color' property accepts all colors, as well as the keyword invert. ''Invert'' 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. Conformant UAs may ignore the ''invert'' value on platforms that do not support color inversion of the pixels on the screen. If the UA does not support the ''invert'' value then it must reject that value at parse-time, and the initial value of the 'outline-color' property is the ''currentColor'' [[!CSS3COLOR]] keyword. The 'outline' property is a shorthand property, and sets all three of 'outline-style', 'outline-width', and 'outline-color'. Note: The outline is the same on all sides. In contrast to borders, there are no 'outline-top' or 'outline-left' etc. properties. 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.

Example(s): Here's an example of drawing a thick outline around a BUTTON element:


button { outline: thick solid }
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, selecting a button, etc.).

Example(s): 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:


:focus  { outline: thick solid black }
:active { outline: thick solid red }
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.

'outline-offset' property

By default, the outline is drawn starting just outside the border edge. However, it is possible to offset the outline and draw it beyond the border edge.
Name:outline-offset
Value:<length>
Initial:0
Applies to:all elements
Inherited:no
Percentages:N/A
Media:visual
Computed value:<length> value in absolute units (px or physical).
Animatable:as length
If the computed value of 'outline-offset' is anything other than 0, then the outline is outset from the border edge by that amount.

Example(s): 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:


:focus,:active  { outline-offset: 2px }

Resizing & Overflow

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.

'resize' property

The 'resize' property allows the author to specify whether or not an element is resizable by the user, and if so, along which axis/axes.
Name:resize
Value: none | both | horizontal | vertical
Initial:none
Applies to:elements with 'overflow' other than visible
Inherited:no
Percentages:N/A
Media:visual
Computed value:specified value.
Animatable:no
none
The UA does not present a resizing mechanism on the element, and the user is given no direct manipulation mechanism to resize the element.
both
The UA presents a bidirectional resizing mechanism to allow the user to adjust both the height and the width of the element.
horizontal
The UA presents a unidirectional horizontal resizing mechanism to allow the user to adjust only the width of the element.
vertical
The UA presents a unidirectional vertical resizing mechanism to allow the user to adjust only the height of the element.
Currently it is possible to control the appearance of the scrolling mechanism (if any) on an element using the 'overflow' property (e.g. 'overflow: scroll' vs. 'overflow: hidden' etc.). The purpose of the 'resize' property is to also allow control over the appearance and function of the resizing mechanism (e.g. a resize box or widget) on the element. 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. The 'resize' property applies to elements whose computed 'overflow' value is something other than ''visible''. When an element is resized by the user, the user agent keeps track of a resize factor (which is initially 1.0) for the width and height, which it then applies to the computed width and height as part of determining the used width and height. The element's contents (and surroundings) are reformatted as necessary. The resize factor introduces a step in width/height calculations and formatting as described in chapter 10 of CSS2.1. Specifically the following step is inserted between steps 1 and 2 of the algorithm in section 10.4 and 10.7 in CSS2.1 [[!CSS21]], where [dimension] is 'width' for 10.4 and 'height' for 10.7.

1b. If the resize [dimension] factor is not 1.0, then the tentative used [dimension] is multiplied by that factor, and the rules above are applied again, but this time using the result of that multiplication as the computed value for '[dimension]'.

With regard to interactivity and the Document Object Model (DOM), the resize factor on an element lasts the lifetime of the element, however, if the 'resize' property itself is altered (e.g. via pseudo-class change or via DOM manipulation), then the resize factor is reset to 1.0. 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 factors including whether the element is absolutely positioned, whether it is positioned using the 'right' and 'bottom' properties, whether the language of the element is right-to-left etc. The precise direction of resizing is left to the UA to properly determine for the platform. The user agent may restrict the resizing range to something suitable, such as between the original formatted size of the element, and large enough to encompass all the element's contents.

Example(s): For example, to make iframes scrollable and resizable, the following rule can be used:


iframe,object[type^="text/"],
object[type$="+xml"],object[type="application/xml"]
{
  overflow:auto;
  resize:both;
}

Overflow Ellipsis: the 'text-overflow' property

Name: text-overflow
Value: [ clip | ellipsis | <> ]{1,2}
Initial: clip
Applies to: block containers
Inherited: no
Percentages: N/A
Media: visual
Computed value: as specified
Animatable: no
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 'overflow' other than ''visible''. Text can overflow for example when it is prevented from wrapping (e.g. due to 'white-space: nowrap' or a single word is too long to fit). Values have the following meanings:
clip
Clip inline content that overflows. Characters may be only partially rendered.
ellipsis
Render an ellipsis character (U+2026) to represent clipped inline content. Implementations may substitute a more language/script-appropriate ellipsis character, or three dots "..." if the ellipsis character is unavailable.
<>
Render the given string to represent clipped inline content. The given string is treated as an independent paragraph for bidi purposes.
Note: The <string> value, and the 2-value syntax "{1,2}" and functionality are all at risk. The term "character" is used in this property definition for better readability and means "grapheme cluster" [[!UAX29]] for implementation purposes. If there is one value, it applies only to the end line box edge. If there are two values, the first value applies to the line-left edge, and the second value applies to the line-right edge. The terms end, line-left and line-right are defined in [[!CSS3-WRITING-MODES]]. Note: the use of line-left and line-right rather than start and end when there are two values is intentional, to facilitate the use of directional characters such as arrows. For the ellipsis and string values, implementations must hide characters and atomic inline-level elements 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 atomic inline-level element on a line must be clipped rather than ellipsed.

ellipsing details

user interaction with ellipsis

Example(s):

text-overflow examples

These examples demonstrate setting the text-overflow of a block container element that has text which overflows its dimensions: sample CSS for a div:
div {
  font-family:Helvetica,sans-serif; line-height:1.1;
  width:3.1em; padding:.2em; border:solid .1em black; margin:1em 0;
}
sample HTML fragments, renderings, and your browser:
HTMLsample renderingyour browser
<div>
CSS IS AWESOME, YES
</div>
First, a box with text drawing outside of it.
CSS IS AWESOME, YES
<div style="text-overflow:clip; overflow:hidden">
CSS IS AWESOME, YES
</div>
Second, a similar box with the text clipped outside the box.
CSS IS AWESOME, YES
<div style="text-overflow:ellipsis; overflow:hidden">
CSS IS AWESOME, YES
</div>
Third, a similar box with an ellipsis representing the clipped text.
CSS IS AWESOME, YES
<div style="text-overflow:ellipsis; overflow:hidden">
NESTED
 <p>PARAGRAPH</p>
WON'T ELLIPSE.
</div>
Fourth, a box with a nested paragraph demonstrating anonymous block boxes equivalency and non-inheritance into a nested element.
NESTED

PARAGRAPH WON'T ELLIPSE.

Note: the side of the line that the ellipsis is placed depends on the 'direction' of the block. E.g. an overflow hidden right-to-left (direction: rtl) block clips inline content on the left side, thus would place a text-overflow ellipsis on the left to represent that clipped content.

ellipsis interaction with scrolling interfaces

This section applies to elements with text-overflow other than ''clip'' (non-clip text-overflow) and overflow:scroll. When an element with non-clip text-overflow has overflow of scroll in the inline progression dimension of the text, and the browser provides a mechanism for scrolling (e.g. a scrollbar on the element, or a touch interface to swipe-scroll, etc.), there are additional implementation details that provide a better user experience: When an element is scrolled (e.g. by the user, DOM manipulation), more of the element's content is shown. The value of text-overflow should not affect whether more of the element's content is shown or not. If a non-clip text-overflow is set, then as more content is scrolled into view, implementations should show whatever additional content fits, only truncating content which would otherwise be clipped (or is necessary to make room for the ellipsis/string), until the element is scrolled far enough to display the edge of the content at which point that content should be displayed rather than an ellipsis/string.

Example(s): This example uses text-overflow on an element with overflow scroll to demonstrate the above described behavior. sample CSS:


div.crawlbar {
	text-overflow: ellipsis;
	height: 2em;
	overflow: scroll;
	white-space: nowrap;
	width: 15em;
	border:1em solid black;
}
sample HTML fragment:

<div class="crawlbar">
CSS is awesome, especially when you can scroll 
to see extra text instead of just
having it overlap other text by default.
</div>
demonstration of sample CSS and HTML:
CSS is awesome, especially when you can scroll to see extra text instead of just having it overlap other text by default.
As some content is scrolled into view, it is likely that other content may scroll out of view on the other side. If that content's block container element is the same that's doing the scrolling, and the computed value of 'text-overflow' has two values, with the first a non-clip value, then implementations must render an ellipsis/string in place of the clipped content, with the same details as described in the value definition above, except that the ellipsis/string is drawn in the start (rather than end) of the block's direction (per the direction property). While the content is being scrolled, implementations may adjust their rendering of ellipses/strings (e.g. align to the box edges rather than line edges).

Example(s): Same as previous example except with text-overflow: ellipsis ellipsis, demonstrated:

CSS is awesome, especially when you can scroll to see extra text instead of just having it overlap other text by default.
If there is insufficient space for both start and end ellipses/strings, then only the end ellipsis/string should be rendered.

Pointing Devices and Keyboards

Pointer interaction

'cursor' property

Name:cursor
Value: [ [<uri> [<x> <y>]?,]*
[ auto | default | none |
context-menu | help | pointer | progress | wait |
cell | crosshair | text | vertical-text |
alias | copy | move | no-drop | not-allowed | grab | grabbing |
e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize | ew-resize | ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out
] ]
Initial:auto
Applies to:all elements
Inherited:yes
Percentages:N/A
Media:visual, interactive
Computed value:as specified, except with any relative URLs converted to absolute
Animatable:no
This property specifies the type of cursor to be displayed for the pointing device when within the element's border-box. Values have the following meanings: image cursors
<uri>
The user agent retrieves the cursor from the resource designated by the URI. If the user agent cannot handle the first cursor of a list of cursors, it must attempt to handle the second, etc. If the user agent cannot handle any user-defined cursor, it must use the cursor keyword at the end of the list. Conforming User Agents may, instead of <uri>, support <image> which is a superset. The default object size for cursor images is a UA-defined size that should be based on the size of a typical cursor on the UA's operating system. The optional <x> and <y> coordinates identify the exact position within the image which is the pointer position (i.e., the hotspot).
<x>
<y>
Each is a <number>. The x-coordinate and y-coordinate of the position in the cursor's coordinate system (left/top relative) which represents the precise position that is being pointed to. If the values are unspecified, then the intrinsic hotspot defined inside the image resource itself is used. If both the values are unspecific and the referenced cursor has no defined hotspot, the effect is as if a value of "0 0" were specified. If the coordinates of the hotspot, as specified either inside the image resource or by <x> and <y> values, fall outside of the cursor image, they must be clamped (independently) to fit.
general purpose cursors
auto
The UA determines the cursor to display based on the current context.
default
The platform-dependent default cursor. Often rendered as an arrow.
none
No cursor is rendered for the element.
links and status cursors
context-menu
A context menu is available for the object under the cursor. Often rendered as an arrow with a small menu-like graphic next to it.
help
Help is available for the object under the cursor. Often rendered as a question mark or a balloon.
pointer
The cursor is a pointer that indicates a link.
progress
A progress indicator. The program is performing some processing, but is different from ''wait'' in that the user may still interact with the program. Often rendered as a spinning beach ball, or an arrow with a watch or hourglass.
wait
Indicates that the program is busy and the user should wait. Often rendered as a watch or hourglass.
selection cursors
cell
Indicates that a cell or set of cells may be selected. Often rendered as a thick plus-sign with a dot in the middle.
crosshair
A simple crosshair (e.g., short line segments resembling a "+" sign). Often used to indicate a two dimensional bitmap selection mode.
text
Indicates text that may be selected. Often rendered as a vertical I-beam. User agents may automatically display a horizontal I-beam/cursor (e.g. same as the ''vertical-text'' keyword) for vertical text, or for that matter, any angle of I-beam/cursor for text that is rendered at any particular angle.
vertical-text
Indicates vertical-text that may be selected. Often rendered as a horizontal I-beam.
drag and drop cursors
alias
Indicates an alias of/shortcut to something is to be created. Often rendered as an arrow with a small curved arrow next to it.
copy
Indicates something is to be copied. Often rendered as an arrow with a small plus sign next to it.
move
Indicates something is to be moved.
no-drop
Indicates that the dragged item cannot be dropped at the current cursor location. Often rendered as a hand or pointer with a small circle with a line through it.
not-allowed
Indicates that the requested action will not be carried out. Often rendered as a circle with a line through it.
grab
Indicates that something can be grabbed (dragged to be moved). Often rendered as the backside of an open hand.
grabbing
Indicates that something is being grabbed (dragged to be moved). Often rendered as the backside of a hand with fingers closed mostly out of view.
resizing and scrolling cursors
e-resize, n-resize, ne-resize, nw-resize, s-resize, se-resize, sw-resize, w-resize
Indicates that some edge is to be moved. For example, the ''se-resize'' cursor is used when the movement starts from the south-east corner of the box.
ew-resize, ns-resize, nesw-resize, nwse-resize
Indicates a bidirectional resize cursor.
col-resize
Indicates that the item/column can be resized horizontally. Often rendered as arrows pointing left and right with a vertical bar separating them.
row-resize
Indicates that the item/row can be resized vertically. Often rendered as arrows pointing up and down with a horizontal bar separating them.
all-scroll
Indicates that the something can be scrolled in any direction. Often rendered as arrows pointing up, down, left, and right with a dot in the middle.
zooming cursors
zoom-in, zoom-out
Indicates that something can be zoomed (magnified) in or out, and often rendered as a magnifying glass with a "+" or "-" in the center of the glass, for ''zoom-in'' and ''zoom-out'' respectively.
The UA may treat unsupported values as ''auto''. E.g. on platforms that do not have a concept of a ''context-menu'' cursor, the UA may render ''default'' or whatever is appropriate.
Example: cursor fallback Here is an example of using several cursor values.

:link,:visited {
    cursor: url(example.svg#linkcursor),
            url(hyper.cur),
            url(hyper.png) 2 3,
            pointer
}
This example sets the cursor on all hyperlinks (whether visited or not) to an external SVG cursor ([[SVG10]], section 16.8.3). User agents that don't support SVG cursors would simply skip to the next value and attempt to use the "hyper.cur" cursor. If that cursor format was also not supported, the UA could attempt to use the "hyper.png" cursor with the explicit hot spot. Finally if the UA does not support any of those image cursor formats, the UA would skip to the last value and render the ''pointer'' cursor.
Cursor of the canvas
The document canvas is the infinite surface over which the document is rendered [[!CSS21]]. Since no element corresponds to the canvas, in order to allow styling of the cursor when not over any element, the canvas cursor re-uses the root element's cursor. However, if no boxes are generated for the root element (for example, if the root element has ''display: none''), then the canvas cursor is the platform-dependent default cursor. Note: An element might be invisible, but still generate boxes. For example, if the element has ''visibility: hidden'' but not ''display: none'', boxes are generated for it and its cursor is used for the canvas.

Insertion caret

Coloring the insertion caret: caret-color

Name: caret-color
Value: auto | <color>
Initial:auto
Applies to:elements that accept input
Inherited:no
Percentages:N/A
Media:interactive
Computed value:The computed value for ''auto'' is ''currentColor''. For <color> values, the computed value is as defined for the [[!CSS3COLOR]] 'color' property.
Animatable:no
auto
the color of the element.
<color>
the insertion caret is colored with the specified color.
The caret is a visible indicator of the insertion point in an element where text (and potentially other content) is inserted by the user. This property controls the color of that visible indicator. Note: caret shape and blinking is outside the scope of this feature and thus unspecified.
Example: a textarea with caret-color:#00aacc;
Note: The caret-color property is at risk.

Keyboard control

Name: nav-up, nav-right, nav-down, nav-left
Value: auto | <id> [ current | root | <target-name> ]?
Initial:auto
Applies to:all enabled elements
Inherited:no
Percentages:N/A
Media:interactive
Computed value:as specified
Animatable:no
auto
The user agent automatically determines which element to navigate the focus to in response to directional navigational input.
<id>

The <id> value is an ID selector [[SELECT]]. In response to directional navigation input corresponding to the property, the focus is navigated to the first element in tree order matching the selector. If this refers to the currently focused element, the directional navigation input respective to the nav- property is ignored — there is no need to refocus the same element. If no element matches the selector, the user agent automatically determines which element to navigate the focus to.

<target-name>
The <target-name> parameter indicates the target frame for the focus navigation. It is a <string> and it cannot start with the underscore "_" character. If the specified target frame does not exist, the parameter will be treated as the keyword ''current'', which means to simply use the frame that the element is in. The keyword ''root'' indicates that the user agent should target the full window.
User agents for devices with directional navigation keys respond by navigating the focus according to four respective nav-* directional navigation properties (nav-up, nav-right, nav-down, nav-left). This specification does not define which keys of a device are directional navigational keys. Note: Typical personal computers have keyboards with four arrow keys. One possible implementation would be to use those four arrow keys for directional navigation. For accessibility and user convenience, user agents should allow configuration of which keys on a keyboard are used for directional navigation.
Example: positioned buttons
Here is an example of buttons positioned in a diamond shape whose directional focus navigation is set in such a way to navigate the focus clockwise (or counter-clockwise) around the diamond shape when the user chooses to navigate sequentially or directionally.

button { position:absolute }

button#b1 {
	top:0; left:50%;
	nav-right:#b2; nav-left:#b4;
	nav-down:#b2; nav-up:#b4;
}

button#b2 {
	top:50%; left:100%;
	nav-right:#b3; nav-left:#b1;
	nav-down:#b3; nav-up:#b1;
}

button#b3 {
	top:100%; left:50%;
	nav-right:#b4; nav-left:#b2;
	nav-down:#b4; nav-up:#b2;
}

button#b4 {
	top:50%; left:0;
	nav-right:#b1; nav-left:#b3;
	nav-down:#b1; nav-up:#b3;
}
Whatever markup sequence the buttons may have (which is not specified in this example) is irrelevant in this case because they are positioned, and yet, it is still important to ensure focus navigation behaviors which relate reasonably to the specified layout.
Example: moving focus to inside a frame
Moving the focus to an element in a specific frame requires both the element's id and the frame's name. This example shows how to make navigating left from the button with id "foo" move the focus to the element with id "bar" within the frame named "sidebar".

button#foo { nav-left: #bar "sidebar"; }

Input method editor: the 'ime-mode' property

Name: ime-mode
Value: auto | normal | active | inactive | disabled
Initial:auto
Applies to:text fields
Inherited:no
Percentages:N/A
Media:interactive
Computed value:as specified
Animatable:no
The 'ime-mode' CSS property controls the state of the input method editor for text fields.
auto
No change is made to the current input method editor state. This is the default.
normal
The IME state should be normal; this value can be used in a user style sheet to override the page setting.
active
The input method editor is initially active; text entry is performed using it unless the user specifically dismisses it.
inactive
The input method editor is initially inactive, but the user may activate it if they wish.
disabled
The input method editor is disabled and may not be activated by the user.

Example: disabling input method support

<input type="text" name="name" value="initial value" style="ime-mode: disabled">
This example disables input method support for a field; this might be necessary for fields that enter data into a database that doesn't support extended character sets, for example.

Example: user preference

input[type=password] {
    ime-mode: auto !important;
}
This example CSS may be placed into a user style sheet file to force password input fields to behave in a default manner.
Note: In general, it's not appropriate for a public web site to manipulate the IME mode setting. This property should be used for web applications and the like. Authors should not rely on disabling IME to prevent extended characters from passing through a form. Even with IME disabled, users can still paste extended characters into a form's fields. Note: The 'ime-mode' property is at risk.

Appendix A. Acknowledgments

This appendix is informative. Thanks to feedback and contributions from L. David Baron, Bert Bos, Matthew Brealey, Ada Chan, Michael Day, Micah Dubinko, Elika E., Steve Falkenburg, Al Gilman, Ian Hickson, Bjoern Hoehrmann, David Hyatt, Richard Ishida, Sho Kuwamoto, Susan Lesch, Peter Linss, Brad Pettit, Alexander Savenkov, Sebastian Schnitzenbaumer, Etan Wexler, David Woolley and Domel.

Appendix B. Changes

This appendix is informative. In general this draft contains numerous editorial/grammatical/spelling corrections, and several new informative examples. This appendix describes minor functional changes from the Candidate Recommendation (CR) of 11 May 2004 that were made to reflect implementer adoption (or lack thereof) in the seven years since. In particular, changes since the CR fall into one of three categories:

List of substantial changes

Appendix C. Default style sheet additions for HTML

This appendix is informative. Potential additions to the base style sheet to express HTML form controls, and a few dynamic presentation attributes:

:enabled:focus {
 outline: 2px inset;
}

button,
input[type=button],
input[type=reset],
input[type=submit],
input[type=checkbox],
input[type=radio],
textarea,
input,
input[type=text],
input[type=hidden],
input[type=password],
input[type=image]
{
 display: inline-block;
 white-space: nowrap;
}

button
{
/* white space handling of BUTTON tags in particular */
 white-space:normal;
}

input[type=reset]:lang(en)
{
/* default content of HTML input type=reset button, per language */
 content: "Reset";
}

input[type=submit]:lang(en)
{
/* default content of HTML input type=submit button, per language */
 content: "Submit";
}

/* UAs should use language-specific Reset/Submit rules for others. */

input[type=button],
input[type=reset][value],
input[type=submit][value]
{
/* text content/labels of HTML "input" buttons */
 content: attr(value);
}

textarea
{
/* white space handling of TEXTAREA tags in particular */
 white-space:pre-wrap;
}

input[type=hidden]
{
/* appearance of the HTML hidden text field in particular */
 display: none;
}

input[type=image]
{
 display: inline-block;
 content: attr(src,url);
 border: none;
}

select[size]
{
/* HTML4/XHTML1 <select> w/ size more than 1 - appearance of list */
 display: inline-block;
 height: attr(size,em);
}

select,select[size=1]
{
/* HTML4/XHTML1 <select> without size, or size=1 - popup-menu */
 display: inline-block;
 height: 1em;
 overflow: hidden;
}

select[size]:active
{
/* active HTML <select> w/ size more than 1 - appearance of active list */
 display: inline-block;
}

optgroup,option
{
 display: block;
 white-space: nowrap;
}

optgroup[label],option[label]
{
 content: attr(label);
}

option[selected]::before
{
 display: inline;
 content: check;
}

/* Though FRAME resizing is not directly addressed by this specification,
   the following rules may provide an approximation of reasonable behavior. */

/*

frame { resize:both }
frame[noresize] { resize:none }

*/

Appendix D: Test Suite

This appendix is informative. This specification shall refer to a test suite written according to the CSS Test Suite Documentation and following the CSS2.1 Test Case Authoring Guidelines. The test suite shall allow user agents to verify their basic conformance to the specification. This test suite does not pretend to be exhaustive and does not cover all possible combinations of user interface related features. These tests will be made available from the CSS Test Suites home page. Related issue: 1.