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
Property | Browser Support | ||||
---|---|---|---|---|---|
resize | |||||
box-sizing | |||||
outline-offset |
The resize property is supported in Firefox, Chrome, and Safari.
The box-sizing is supported in Internet Explorer, Chrome, Safari, and Opera. Firefox requires the prefix -moz-.
The outline-offset property is supported in all major browsers, except Internet Explorer.
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 Firefox, Chrome, and Safari).
The CSS code is as follows:
![Opera Opera](http://www.w3schools.com/images/incompatible_opera2020.gif)
![Safari Safari](http://www.w3schools.com/images/compatible_safari2020.gif)
![Chrome Chrome](http://www.w3schools.com/images/compatible_chrome2020.gif)
![Firefox Firefox](http://www.w3schools.com/images/compatible_firefox2020.gif)
![Internet Explorer Internet Explorer](http://www.w3schools.com/images/incompatible_ie2020.gif)
Example
Specify that a div element should be resizable by the user:
div
{
resize:both;
overflow:auto;
}
{
resize:both;
overflow:auto;
}
CSS3 Box Sizing
The box-sizing property allows you to define certain elements to fit an area in a certain way:
![Opera Opera](http://www.w3schools.com/images/compatible_opera2020.gif)
![Safari Safari](http://www.w3schools.com/images/compatible_safari2020.gif)
![Chrome Chrome](http://www.w3schools.com/images/compatible_chrome2020.gif)
![Firefox Firefox](http://www.w3schools.com/images/compatible_firefox2020.gif)
![Internet Explorer Internet Explorer](http://www.w3schools.com/images/compatible_ie2020.gif)
Example
Specify two bordered boxes side by side:
div
{
box-sizing:border-box;
-moz-box-sizing:border-box; /* Firefox */
width:50%;
float:left;
}
{
box-sizing:border-box;
-moz-box-sizing:border-box; /* Firefox */
width:50%;
float:left;
}
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:
![Opera Opera](http://www.w3schools.com/images/compatible_opera2020.gif)
![Safari Safari](http://www.w3schools.com/images/compatible_safari2020.gif)
![Chrome Chrome](http://www.w3schools.com/images/compatible_chrome2020.gif)
![Firefox Firefox](http://www.w3schools.com/images/compatible_firefox2020.gif)
![Internet Explorer Internet Explorer](http://www.w3schools.com/images/incompatible_ie2020.gif)
Example
Specify an outline 15px outside the border edge:
div
{
border:2px solid black;
outline:2px solid red;
outline-offset:15px;
}
{
border:2px solid black;
outline:2px solid red;
outline-offset:15px;
}
New 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 |
-By Parthiv Patel
Parthiv Patel
Bhaishri Info Solution
Sr. PHP Developer
Limdi Chowk, AT PO. Nar, Di. Anand
Nar, Gujarat
388150
India
pparthiv2412@gmail.com
7383343029
DOB: 12/24/1986
No comments:
Post a Comment