# CSS3 User Interface

« Previous
Next Chapter »

## CSS3 User Interface

In CSS3, some of the new user interface features are resizing elements, box sizing, and outlining.

In this chapter you will learn about the following user interface properties:

- resize
- box-sizing
- outline-offset

## Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Numbers followed by -webkit- or -moz- specify the first version that worked with a prefix.

Property |  |  |  |  |
--- | --- | --- | --- | --- | ---
resize | Not supported | 4.0 | 5.0 4.0 -moz- | 4.0 | 15.0
box-sizing | Partial from 8.0 | 10.0 4.0 -webkit- | 29.0 2.0 -moz- | 5.1 3.1 -webkit- | 9.5
outline-offset | Not supported | 4.0 | 5.0 4.0 -moz- | 4.0 | 9.5

## CSS3 Resizing

In CSS3, the resize property specifies whether or not an element should be resizable by the user.

This div element is resizable by the user (in Chrome, Firefox, Safari and Opera 15+).

The CSS code is as follows:

## Example

Specify that a <div> element should be resizable by the user:

div {
resize: both;
overflow: auto;
}
Try it yourself »

## CSS3 Box Sizing

The box-sizing property is used to tell the browser what the sizing properties (width and height) should include.

Should they include the border-box or just the content-box which is the default value of the width and height properties.

For example, if you want two bordered boxes side by side, it can be achieved through setting box-sizing to "border-box". This forces the browser to render the box with the specified width and height, and place the border and padding inside the box.

## Example

Specify two bordered boxes side by side:

div {
-moz-box-sizing: border-box; /* Firefox */
box-sizing: border-box;
width: 50%;
float: left;
}
Try it yourself »

## CSS3 Outline Offset

The outline-offset property offsets an outline, and draws it beyond the border edge.

Outlines differ from borders in two ways:

- Outlines do not take up space
- Outlines may be non-rectangular

This div has an outline 15px outside the border edge.

The CSS code is as follows:

## Example

Specify an outline 15px outside the border edge:

div {
border: 2px solid black;
outline: 2px solid red;
outline-offset: 15px;
}
Try it yourself »

## CSS3 User-interface Properties

The following table lists all the user-interface properties:

Property | Description | CSS
--- | --- | ---
appearance | Allows you to make an element look like a standard user interface element | 3
box-sizing | Allows you to define certain elements to fit an area in a certain way | 3
icon | Provides the author the ability to style an element with an iconic equivalent | 3
nav-down | Specifies where to navigate when using the arrow-down navigation key | 3
nav-index | Specifies the tabbing order for an element | 3
nav-left | Specifies where to navigate when using the arrow-left navigation key | 3
nav-right | Specifies where to navigate when using the arrow-right navigation key | 3
nav-up | Specifies where to navigate when using the arrow-up navigation key | 3
outline-offset | Offsets an outline, and draws it beyond the border edge | 3
resize | Specifies whether or not an element is resizable by the user | 3

« Previous
Next Chapter »

### WEB HOSTING

UK Reseller Hosting

### WEB BUILDING

FREE Website BUILDER Free HTML5 Templates

### W3SCHOOLS EXAMS

HTML, CSS, JavaScript, PHP, jQuery, XML, and ASP Certifications

### SHARE THIS PAGE

### Color Picker

### HTML/CSS

HTML Tutorial HTML5 Tutorial CSS Tutorial CSS3 Tutorial Bootstrap Tutorial

### JavaScript

JavaScript Tutorial jQuery Tutorial jQuery Mobile Tutorial AngularJS Tutorial AJAX Tutorial JSON Tutorial

### Graphics

Canvas Tutorial SVG Tutorial Google Maps Tutorial

### Server Side

SQL Tutorial PHP Tutorial ASP Tutorial ASP.NET Tutorial VBScript Tutorial AppML Tutorial

### Web

Web Building Web Statistics Web Certification

### XML

XML Tutorial DTD Tutorial Schema Tutorial XML DOM Tutorial XPath Tutorial XSLT Tutorial XQuery Tutorial XSL-FO Tutorial RSS Tutorial WSDL Tutorial

### HTML/CSS

HTML Tag Reference HTML Event Reference HTML Color Reference CSS 1,2,3 Reference Bootstrap Reference

### JavaScript

JavaScript Reference HTML DOM Reference jQuery Reference jQuery Mobile Reference Google Maps Reference

### Server Side

PHP Reference SQL Reference ASP Reference VBScript Reference Razor Reference ASP.NET Reference

### XML

XML DOM Reference XSLT Reference XSL-FO Reference XPath Reference XQuery Reference Schema Reference RSS Reference SVG Reference

### HTML Charsets

HTML Character Sets HTML ASCII HTML ANSI HTML Windows-1252 HTML ISO-8859-1 HTML Symbols HTML UTF-8

### HTML/CSS

HTML Examples CSS Examples

### Browser Scripting

JavaScript Examples HTML DOM Examples jQuery Examples jQuery Mobile Examples AngularJS Examples AJAX Examples

### Server Scripting

PHP Examples ASP Examples VBScript Examples Razor Examples .NET Examples

### XML Languages

XML Examples DTD Examples XML DOM Examples XSL Examples XSLT Examples XPath Examples XQuery Examples Schema Examples RSS Examples SVG Examples