CSS3 user interface


Release date:2024-01-17 Update date:2024-01-17 Editor:admin View counts:74

Label:

CSS3 user interface

CSS3 user interface

In CSS3, some new user interface features have been added to resize elements, boxes, and borders.

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

  • Resize

  • Box-sizing

  • Outline-offset

Browser support

The number in the table represents 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 prefix attribute.

Attribute

Resize

4.0

79.0

5.0 4.0-moz-

4.0

15.0

Box-sizing

10.04.0-webkit-

8.0

29.02.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 Resize (Resizing)

In CSS3 resize property specifies whether an element should be resized by the user. This div element is resized by the user. (in Firefox 4, Chrome, and Safari)

The CSS code is as follows:

Example

A div element size is specified by the user:

div
{
    resize:both;
    overflow:auto;
}

CSS3 box resizing (Box Sizing)

box-sizing property allows you to define specific content that fits an area in an exact way.

Example

Specify two side-by-side boxes with borders:

div
{
    border:2px solid black;
    outline:2px solid red;
    outline-offset:15px;
}

CSS3 shape Modification (outline-offset)

outline-offset property to offset the outline and draw the outline beyond the edge of the border.

An outline differs from a border in two things:

  • The outline does not take up space.

  • The outline may be non-rectangular

The div has an outline 15 pixels outside the border.

The CSS code is as follows:

Example

Specify the outline at 15 pixels outside the edge of the border:

div
{
    border:2px solid black;
    outline:2px solid red;
    outline-offset:15px;
}

New user interface features

Attribute

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 some way by adapting to the region

3

icon

Provides creators with the ability to set elements as icon equivalents.

3

nav-down

Specify where to use the arrow down navigation keys to navigate

3

nav-index

Specify the order of the Tab of an element

3

nav-left

Specify where to navigate using the arrow navigation keys on the left

3

nav-right

Specify where to navigate using the arrow navigation keys on the right

3

nav-up

Specify where to use the arrow up navigation keys to navigate

3

outline-offset

The outer outline modifies and draws the edge beyond the border

3

resize

Specifies whether an element is resized by the user

3

Powered by TorCMS (https://github.com/bukun/TorCMS).