This tutorial will be taking a look at some of the new ways you can manipulate user interface features in CSS3. But what do we mean by “user interface”?
CSS3 brings some great new properties relating to resizing elements, cursors, outlining, box layout and more. We’re focusing on three of the most significant user interface enhancements in this tutorial.
The examples shown below can be seen at our CSS3 examples page. Many, however, can only be appreciated in the latest builds of various browsers:
Resizing
The latest version of Safari has a feature which allows resizable text areas. This is a great addition and one I find myself using daily. CSS3 allows you to easily apply this to any element, eventually to become cross-browser compatible. The code is the resize:both; line:
.ui_resizable {
padding: 20px;
border: 1px solid;
resize: both;
overflow: auto;
}

Box Sizing
The ‘box model’ CSS3 module is one of the more extensive areas, and full information can be found at the official specification. The box sizing aspect allows you to define certain elements to fit an area in a certain way. For example, if you’d like 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.
At present, additional prefixes are required to support this in all browsers – you can see the full list on the example page’s code. Here’s a basic possibility:
.area {
width: 300px;
border: 10px solid #ddccb5;
height: 60px;
}
.boxes {
box-sizing: border-box;
width:50%;
height: 60px;
text-align: center;
border: 5px solid #897048;
padding: 2px;
float:left;
}

Outline
Setting an element outline is already available in CSS2, but in CSS3 includes the facility to offset the outline away from the element – by a value you define. It differs from a border in two ways:
- Outlines do not take up space
- Outlines may be non-rectangular
They can be created as follows:
.ui_outline {
width: 150px;
padding: 10px;
height: 70px;
border: 2px solid black;
outline: 2px solid #897048;
outline-offset: 15px;
}

In conclusion…
These features aren’t revolutionary, and are not likely to cause a stir in the design community. It can’t be denied that they’re useful – in particular giving the reader the ability to resize elements.
The next article in this series will be looking more in-depth at one much more revolutionary feature of CSS3 – multi column text. Remember, to see live examples of these features, take a look at our CSS3 example page.
Other posts in the series
- Introduction to CSS3 – Part 1: What is it?
- Introduction to CSS3 – Part 2: Borders
- Introduction to CSS3 – Part 3: Text Effects
- Introduction to CSS3 – Part 4: User Interface
- Introduction to CSS3 – Part 5: Multiple Columns
- Introduction to CSS3 – Part 6: Backgrounds

Comments & Discussion
25 Comments
Pingback: 70+ 必备的 CSS3 和 HTML5 教程资源 | 芒果
Pingback: 70+ 必备的 CSS3 和 HTML5 教程资源 « SomeDay I'll Fly | Gabriel's blog
Pingback: 70 Fantastic CSS3 and HTML5 Tutorials and Resources | DesignerWall
Pingback: 70 Fantastic CSS3 and HTML5 Tutorials and Resources | Designer Wall
Pingback: 70 Must-Have CSS3 and HTML5 Tutorials and Resources | WebMasterSide.net | Web Resource Center
Pingback: 70+ 必备的 CSS3 和 HTML5 教程资源 | 51Feeling
Pingback: HTML5 和 CSS3 教程资源大网罗
Pingback: Start Using CSS3 Today: Techniques and Tutorials | Web Design Cool
Pingback: Start Using CSS3 Today: Techniques and Tutorials | ZoooZu.com
Pingback: 70个必备的CSS3和HTML5教程资源
Pingback: 70+ 必备的 CSS3 和 HTML5 教程资源 | 俊顶视觉设计网 - 视觉创意,前端开发,web标准设计,高端网站,网页设计教程,网站策划,网站推广,网络营销。
Pingback: 70 CSS3 and HTML5 Tutorials and Resources « W3 Web Designer | Kerala Web Designer
Pingback: Start Using CSS3 Today: Techniques and Tutorials | Best Web Magazine
Pingback: 70 Must-Have CSS3 and HTML5 Tutorials and Resources - NAGPUR CITY
Pingback: Html5 Solution
Pingback: 70+ 必备的 CSS3 和 HTML5 教程资源 | zend实验室-java/php学习教程、web前端设计、网站建设、网页设计、网络SEO推广