CSS level 3 is currently under development. The W3C maintains a CSS3 progress report. CSS3 is modularized and will consist of several separate recommendations. The W3C CSS3 Roadmap provides a summary and introduction.
Many exciting new functions and features are being thought up for CSS3. I’ll showcase some amazing examples below and let me know what you think by leaving a comment.
How to create colored borders with CSS3
W3C has offered some new options for borders in CSS3, of which, next to rounded borders, border-color is also very interesting. Mozila/Firefox has implemented this function, which allows you to create cool colored borders.
This is an example:

Here is the CSS3 code:
border: 8px solid #000; -moz-border-bottom-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc; -moz-border-top-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc; -moz-border-left-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc; -moz-border-right-colors: #555 #666 #777 #888 #999 #aaa #bbb #ccc; padding: 5px 5px 5px 15px;
Box-shadow, one of CSS3’s best new features
The CSS3 backgrounds and borders module has a nice new feature called box-shadow, which is implemented in Safari 3+ and Firefox 3.1 (Alpha). The specification speaks of multiple shadows, but the author already “has his doubts” on that, and it isn’t implemented in Safari 3.
The property takes 3 lengths and a color as it’s attributes, the lengths are:
- the horizontal offset of the shadow, positive means the shadow will be on the right of the box, a negative offset will put the shadow on the left of the box;
- the vertical offset, a negative one means the box-shadow will be on top of the box, a positive one means the shadow will be below the box;
- the blur radius, if set to 0 the shadow will be sharp, the higher the number, the more blurred it will be.
The shadow should be following curved corners created with border-radius. For those of you without a supporting browser, here’s a screenshot.

Here is the CSS3 code:
box-shadow: 10px 10px 5px #888; padding: 5px 5px 5px 15px;
Border-radius: create rounded corners with CSS!
W3C has offered some new options for borders in CSS3, of which one is border-radius. Both Mozila/Firefox and Safari 3 have implemented this function, which allows you to create round corners on box-items.
This is an example:

Here is the CSS3 code:
< div style=" background-color: #ccc; -moz-border-radius: 5px; -webkit-border-radius: 5px; border: 1px solid #000; padding: 10px;" >
Multiple backgrounds with CSS3
CSS3 allows for multiple background images on one element. To do this, you can separate backgrounds by commas.
Here is the CSS3 code:
background: url(body-top.gif) top left no-repeat, url(banner_fresco.jpg) top 11px no-repeat, url(body-bottom.gif) bottom left no-repeat, url(body-middle.gif) left repeat-y;
The only browser projects having this feature implemented so far are WebKit and KHTML (Konqueror). This got into Safari 1.3 though, and works in OmniWeb 5.5 and up.
Text-shadow, Photoshop like effects using CSS
CSS3 finally eliminates the need for Photoshop when all you want to do is a simple shadow. The text-shadow property is used as follows:
text-shadow: 2px 2px 2px #000;
This produces the following text with a shadow 2px right and below of the text, which blurs for 2px:

Note: This feature is NOT new in CSS3; it was originally proposed in CSS2. Safari had it from version 1, however!
The following works in Opera, Konqueror, iCab and Firefox 3.1a, and looks really cool (or, rather, the opposite!):

Multi-column layout
W3C offers a new way to arrange text “news-paper wise”, in columns. Multi-column layout is actually a module on its own. It allows a webdeveloper to let text be fitted into columns, in two ways: by defining a width for each column, or by defining a number of columns. The first would be done by column-width, the latter by column-count. To create a space between the columns, you need to specify a width for column-gap.
Multi-column layout is currently only supported in Mozilla based browsers and Safari 3, who have prefixed the properties with respectively -moz- and -webkit-. The example below is done with column-width, the CSS for it is as follows:
-moz-column-width: 13em; -webkit-column-width: 13em; -moz-column-gap: 1em; -webkit-column-gap: 1em;
Which results in the following:

The next example is done with column-count, and has the following code:
-moz-column-count: 3; -moz-column-gap: 1em; -moz-column-rule: 1px solid black; -webkit-column-count: 3; -webkit-column-gap: 1em; -webkit-column-rule: 1px solid black;
Which in turn results in the following:

A feature which isn’t implemented yet is column-space-distribution, this should describe how to distribute the space between the columns if there’s rest space left.
Jason Harrop has created a multicolumn extension for Firefox which allows you to apply these CSS properties to whatever page you like.
Web fonts with @font-face
Not exactly a feature which is new to CSS3, @font-face was first proposed for CSS2 and has been implemented in Internet Explorer since version 5! However, their implementation relied on the proprietary Embedded Open Type (.eot) format, and no other browsers decided to use this format. With the release of Safari 3.1, however, website makers can use any licensed TrueType (.ttf) or OpenType (.otf) font in their pages.
To use web fonts, each form of the font family must be declared using the @font-face rule; for example, to use both regular and italic forms of Jos Buivenga’s Delicious font, you would put the following in your stylesheet:
@font-face { font-family: Delicious; src: url('Delicious-Roman.otf'); } @font-face { font-family: Delicious; font-weight: bold; src: url('Delicious-Bold.otf'); }
Then call it using font-family:
h3 { font-family: Delicious, sans-serif; }
Here is an example of the results:

The @font-face rule is planned (although not confirmed) for Firefox 3.1 and Opera 10. You can see more examples linked from this article at A List Apart.
Note: As with images and other media, check the license of the font you wish to use before implementing it. Many fonts are not yet licensed for this kind of use on the web.
CSS3 Speech
CSS2 added support for the Aural media type which is used for “styling” speech synthesis in aural user agents (e.g. screen readers). The specification added several properties to this new media type.
The current Working Draft of CSS2.1 reserves media=”speech”, but explicitly does not define which properties apply to it. Also, the aural media type has been deprecated.
The CSS 3 Speech module removes some of the old properties and adds new ones. All of them are now assigned to the speech media type.
Opera is one of the most popular user agents implementing most of the CSS 3 Speech properties.
The code used to style speech is:
#voice-volume { -xv-voice-volume: x-soft; -xv-voice-balance: right; } #voice-balance { -xv-voice-balance: left; } #speech-cue { cue-after: url(ding.wav); } #voice-rate { -xv-voice-rate: x-slow; } #voice-family { voice-family: female; } #voice-pitch { -xv-voice-pitch: x-low; } #speech-speak { speak: spell-out; }
Note: Since CSS 3 Speech module is still a Working Draft, Opera implements some of its properties using the -xv- prefix.
Recent Comments