Login

Username:

Password: 

Join us Now |  Forgot Password? | Forgot UserName?

CSS 3

Learn step by step



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
CSS3 Resizing

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


<style>
div
{
border:2px solid;
padding:10px 40px;
width:300px;
resize:both;
overflow:auto;
background:#F5B0F6
}
</style>
<div>The resize property specifies whether or not an element is resizeable by the user.</div>

Output

The resize property specifies whether or not an element is resizeable by the user.
CSS3 Box Sizing

The box-sizing property allows you to define certain elements to fit an area in a certain way:


<style>
div.container
{
width:30em;
border:1em;
}
div.box
{
-moz-box-sizing:border-box; /* Firefox */
box-sizing:border-box;
width:50%;
border:1em solid green;
float:left;
}
</style>
<div class="container">
<div class="box">This div occupies the left half.</div>
<div class="box">This div occupies the right half.</div>
</div>
Output

Output

This div occupies the left half.
This div occupies the right half.

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

<style>
div
{
margin:20px;
width:150px;
padding:10px;
height:70px;
border:2px solid blue;
outline:2px solid green;
outline-offset:15px;
}
</style>
<div>This div is containing the outline outside of 20px</div>

Output:-

This div containing the outline outside of 20px
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 resizeable by the user 3


Related Videos