CSS3 User Interface
CSS3 User Interface
In CSS3, some new user interface features have been added to adjust element size, box sizing, and outlines.
In this chapter, you will learn about the following user interface properties:
- resize
- box-sizing
- outline-offset
Browser Support
The numbers in the table indicate the first browser version number that supports the property.
The number immediately preceding -webkit-, -ms-, or -moz- is the first browser version number that supports the prefixed property.
| Property | |||||
|---|---|---|---|---|---|
| resize | 4.0 | 79.0 | 5.0 4.0 -moz- |
4.0 | 15.0 |
| box-sizing | 10.0 4.0 -webkit- |
8.0 | 29.0 2.0 -moz- |
5.1 3.1 -webkit- |
9.5 |
| outline-offset | 4.0 | 15.0 | 5.0 4.0 -moz- |
4.0 | 9.5 |
CSS3 Resizing
In CSS3, the resize property specifies whether an element should be resized by the user.
The CSS code is as follows:
Example
The user specifies the size of a div element:
Try it Yourself »
CSS3 Box Sizing
The box-sizing property allows you to define specific content in an exact way to fit an area.
Example
Specify two side-by-side bordered boxes:
Try it Yourself »
CSS3 outline styling (outline-offset)
The outline-offset property offsets the outline and draws it beyond the border edge.
There are two differences between outlines and borders:
- Outline takes up no space
- Outlines may be non-rectangular
The CSS code is as follows:
Example
Specifies an outline 15 pixels outside the border edge:
Try it Yourself »
New user interface features
| 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 in a way that fits the area | 3 |
| icon | Provides creators with the ability to set elements as icon equivalents. | 3 |
| nav-down | Specifies where to navigate when using the arrow-down navigation key | 3 |
| nav-index | Specify the tab order of an element | 3 |
| nav-left | Specifies where to navigate using the left arrow navigation key | 3 |
| nav-right | Specifies where to navigate using the right arrow navigation key | 3 |
| nav-up | Specifies where to navigate when using the arrow-up navigation key | 3 |
| outline-offset | Outline is modified and drawn beyond the border edge | 3 |
| resize | Specifies whether an element is resized by the user | 3 |