11 Classic CSS Techniques Made Simple With CSS3

11 Classic CSS Techniques Made Simple with CSS3

Sep 8th, 2009 in HTML & CSS by Vasili

We've all had to achieve some effect that required an extra handful of divs or PNGs. We shouldn't be limited to these old techniques when there's a new age coming. This new age includes the use of CSS3. In today's tutorial, I'll show you eleven different time-consuming effects that can be achieved quite easily with CSS3.

PG

Author: Vasili

This is a NETTUTS contributor who has published 3 tutorial(s) so far here. Their bio is coming soon!

CSS3? What's that?!

I'm sure you've heard of CSS in general. CSS3 isn't that much different, in terms of syntax; however, the power of CSS3 is much greater. As you'll see in these eleven techniques, you can have multiple backgrounds, dynamically resize those backgrounds, border radiuses, text shadows, and more!

Here's what the official (or at least, what I consider official) website of CSS3, css3.info, has to say about CSS3:

CSS3 is the new kid in the stylesheet family. It offers exciting new possibilities to create an impact with your designs, allows you to use more diverse style sheets for a variety of occasions and lots more.

What We'll Be Covering

Here are the 11 techniques that I'll be showing you how to recreate with CSS3. I'll show you how to create them using CSS2 (or JavaScript), and then with CSS3 properties. Remember - these effects will only work in modern browsers that implement these CSS3 features. Your best option is to view these with Safari 4.

  1. Rounded Corners
  2. Box Shadow
  3. Text Shadow
  4. Fancy Font
  5. Opacity
  6. RGBA
  7. Background Size
  8. Multiple Backgrounds
  9. Columns
  10. Border Image
  11. Animations

1. Rounded Corners

Rounded Corners

Probably my favorite on of this list, rounded corners provide a developer with so many options. You can create a rounded corner button in seconds. My favorite thing to do is set a gradient background to repeat along the x-axis and then apply rounded corners to make a very nice looking Web 2.0 button.

You can simulate rounded corners by using four extra divs or by using JavaScript. Though, a user doesn't see these smooth corners if they have JavaScript disabled, I think that's fine as long as the website still functions as it should. You can read up on this method if you would prefer to use pure CSS in making rounded corners.

Classic Way

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.corners.js"></script>
<script type="text/javascript">
$(function(){
	$('.box').corners('10px');
});
</script>

<div class="box">
	<!--CONTENT-->
</div>

The classical method uses jQuery along with a JavaScript plugin called Corners.

CSS3 Way

<style type="text/css">
.box {
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
</style>

<div class="box">
	<!--CONTENT-->
</div>

As you can see, all that you need to do is specify three CSS3 properties. Eventually, it will only be one; you have to use three now because different browsers use different property names.

View the demo.

2. Box Shadow

Box Shadow

Box shadows provide you with a very powerful tool. 99% of the time when I'm desigining, I find myself using drop shadows for something. Once again, I'll be using a jQuery plugin to take care of the classic way because honestly, trying to figure it out with just CSS is confusing. Why should I waste my time fiddling with negative margins when there's already something written that does the job for me? As long as my design looks fine when people have JavaScript disabled, I'm perfectly content using a jQuery plugin.

Classic Way

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.dropShadow.js"></script>
<script type="text/javascript">
$(function(){
	$('.box').dropShadow({
		left: 5,
		top: 5,
		opacity: 1.0,
		color: 'black'
	});
});
</script>

<div class="box">
	<!--CONTENT-->
</div>

I'm using the dropShadow plugin. Simple and what I wanted; though I would prefer to use just CSS ;).

CSS3 Way

<style type="text/css">
.box {
box-shadow: 5px 5px 2px black;
-moz-box-shadow: 5px 5px 2px black;
-webkit-box-shadow: 5px 5px 2px black;
}
</style>

<div class="box">
	<!--CONTENT-->
</div>

The values for the box shadow properties are: x-offset y-offset blur color. Much easier than importing two JavaScript files, and A LOT easier than messing around with background images and negative margins.

View the demo.

3. Text Shadow

Text Shadow

If you've ever read a tutorial about how to make the letterpress effect in Photoshop, you'll know that the drop shadow effect is used. It's really simple to create letterpressed text, just follow this tutorial at Line25 by Chris Spooner.

Classic Way

<style type="text/css">
.font {
font-size: 20px;
color: #2178d9;
}
.fonts {
position: relative;
}
.fonts .font {
position: absolute;
z-index: 200;
}
.fonts .second {
top: 1px;
color: #000;
z-index: 100;
}
</style>

<div class="fonts">
	<span class="font">The quick brown fox jumps over the lazy dog.</span>
	<span class="font second">The quick brown fox jumps over the lazy dog.</span>
</div>

Instead of using a jQuery plugin this time, I just used some simple CSS tricks to absolutely position the text behind the other copy of text. The only bad thing about not using CSS3 for this situation is that you will get two copies of the text if CSS is disabled.

CSS3 Way

<style type="text/css">
.font {
font-size: 20px;
color: #2178d9;
}
.font {
text-shadow: 0 1px 0 #000;
}
</style>

<span class="font">The quick brown fox jumps over the lazy dog.</span>

If you're planning on using text shadows that are blurred (the third "option" in the text-shadow property), I don't know how you would accomplish that with pure CSS, and no images.

View the demo.

4. Fancy Font

Fancy Font

We've dreamed about it for a long time now, but you can finally display "fancy fonts" on the web without relying on JavaScript. Of course this causes some issues with allowing paid fonts to be distributed over the internet. Anyhow, I present you with @font-face.

Classic Way

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="js/cufon.js"></script>
<script type="text/javascript" src="js/loyal.js"></script>
<script type="text/javascript">
$(function(){
	Cufon.replace('.classic .font');
});
</script>
<style type="text/css">
.font {
font-size: 20px;
}
</style>

<span class="font">The quick brown fox jumps over the lazy dog.</span>

I decided to use Cufón to replace the text. I'm not going to explain how to use it because Jeffrey has an awesome screencast already.

CSS3 Way

<style type="text/css">
@font-face {
font-family: 'Loyal';
src: url('loyal.ttf');
}
.font {
font-family: Loyal;
font-size: 20px;
}
</style>

<span class="font">The quick brown fox jumps over the lazy dog.</span>

We create a font family with @font-face and then use it as a value for font-family. Michael Owens wrote an article here about a month ago which explains @font-face quite well.

View the demo.

5. Opacity

Opacity

If you've visited the Envato website redesign lately, you might have noticed that there are a lot of transparent elements. Though this is achieved with transparent PNGs, you can achieve a similar effect by using the opacity property. Now, the opacity property has been around for a while, but our beloved IE has its own properties.

Classic Way

<style type="text/css">
.box {
opacity: .6; // all modern browsers (this is CSS3)
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; // IE 8
filter: alpha(opacity=60); // IE 5-7
}
</style>

<div class="box">
	<!--CONTENT-->
</div>

CSS3 Way

<style type="text/css">
.box {
opacity: .6;
}
</style>

<div class="box">
	<!--CONTENT-->
</div>

With CSS3, we just eliminated two properties that were specific to IE, isn't that great?!

View the demo.

6. RGBA

RGBA

Everyone knows what RGB stands for (red, green, blue), but what does the A stand for? It stands for alpha, which refers to the transparency.

Other than rounded corners, RGBA is my next most used CSS3 property. Sometimes I just want to add a few light white/black background to navigation links when a user hover overs them. It's much easier than creating a new image for each color; however, with a little PHP it makes things a lot easier.

Classic Way

Seeing as how this isn't a PHP article, I won't be going over the PHP. Just save this file as rgba.php and when you need a certain RGBA color, make the background "color" as url(rgba.php?r=R&g=G&b=B&a=A).

<?php
$image = imagecreatetruecolor(1, 1);
$r = (int)$_GET['r'];
$g = (int)$_GET['g'];
$b = (int)$_GET['b'];
$a = (float)$_GET['a'];
$white = imagecolorallocate($image, 255, 255, 255);
$color = imagecolorallocatealpha($image, $r, $g, $b, 127*(1-$a));
imagefill($image, 0, 0, $white);
imagefilledrectangle($image, 0, 0, 1, 1, $color);

header('Content-type: image/png');
imagepng($image);
?>

Now just apply that to a div...

<style type="text/css">
.box {
background: url(rgba.php?r=239&g=182&b=29&a=.25);
}
</style>

<div class="box">
	<!--CONTENT-->
</div>

CSS3 Way

<style type="text/css">
.box {
background: rgba(239, 182, 29, .25);
}
</style>

<div class="box">
	<!--CONTENT-->
</div>

View the demo.

7. Background Size

Background Size

The background size property is an amazing thing to have on your tool belt when you're creating a liquid layout. An example of this could be when you have a background image for a container that is for the sidebar. The classic way of doing this would require tweaking to have the image repeat along the y-axis, but with CSS3 it's like adding another background property.

Classic Way

<style type="text/css">
.box {
position: relative;
overflow: hidden;
}
	.box img {
	position: absolute;
	top: 0;
	left: 0;
	width: 50%;
	height: 50%;
	z-index: 100;
	}
	.box .content {
	position: absolute;
	z-index: 200;
	}
</style>

<div class="box">
	<div class="content">
		<!--CONTENT-->
	</div>
	<img src="http://nettuts.s3.cdn.plus.org/423_screenr/200x200.jpg" alt="" />
</div>

CSS3 Way

<style type="text/css">
.box {
background: #ccc url(http://nettuts.s3.cdn.plus.org/423_screenr/200x200.jpg) no-repeat;
-webkit-background-size: 50%; /* Safari */
-o-background-size: 50%; /* Opera */
-khtml-background-size: 50%; /* Konqueror */
}
</style>

<div class="box">
	<!--CONTENT-->
</div>

Unfortunately, this property isn't implemented into Firefox (V3.5.2) at the time of this writing.

View the demo.

8. Multiple Backgrounds

Multiple Backgrounds

Ah, multiple backgrounds. Now this give developers a very powerful tool. I can think of so many things that require multiple divs just to have more than one background. The most common place I can see this being helpful is in a header section of the website, but that's just the first thing I thought of.

Classic Way

<style type="text/css">
.box {
width: 200px;
height: 150px;
background: url(images/bg.png) repeat-x;
}
	.box2 {
	width: 100%;
	height: 100%;
	background: url(images/text.png) center center no-repeat;
	}
</style>

<div class="box">
	<div class="box2">
		<!--CONTENT-->
	</div>
</div>

The classic method is pretty obvious, just wrap the div with another div and so on for each background you need. Produces lovely looking code, doesn't it?

CSS3 Way

<style type="text/css">
.box {
width: 200px;
height: 150px;
background: url(images/text.png) center center no-repeat, url(images/bg.png) repeat-x;
}
</style>

<div class="box">
	<!--CONTENT-->
</div>

The syntax is really easy to pick up on this one. All you do for the multiple backgrounds is add a comma in between each one! However, once again, this is a limited property and is only in Safari.

View the demo.

9. Columns

Columns

This is the most interesting CSS3 property I've come by. It's not something you see a lot in web design. Myself, I've only seen newspaper-like columns once or twice; however, I love how the effect looks when done correctly. Normally you would separate the content into divs and float those divs, but I found a jQuery plugin which dynamically renders the columns.

Classic Way

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.columnize.js"></script>
<script type="text/javascript">
$(function(){
	$('.columns').columnize({
		columns: 2
	});
});
</script>
<style type="text/css">
.column {
padding-right: 10px;
}
.column.last {
padding: 0;
}
</style>

<div class="columns">
	<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla elementum accumsan mi. Maecenas id dui a magna tempor pretium. Quisque id enim. Proin id tortor. Curabitur sit amet enim vitae quam pharetra imperdiet. Nulla diam ante, pellentesque eu, vestibulum non, adipiscing nec, eros. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Duis a nunc. Donec non dui a velit pulvinar gravida. Nunc rutrum libero vel tortor. Duis sed mi eu metus tincidunt ullamcorper. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In purus lorem, aliquam ac, congue ac, vestibulum quis, felis. Aliquam non sapien.</p>
	<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla elementum accumsan mi. Maecenas id dui a magna tempor pretium. Quisque id enim. Proin id tortor. Curabitur sit amet enim vitae quam pharetra imperdiet. Nulla diam ante, pellentesque eu, vestibulum non, adipiscing nec, eros. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Duis a nunc. Donec non dui a velit pulvinar gravida. Nunc rutrum libero vel tortor. Duis sed mi eu metus tincidunt ullamcorper. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In purus lorem, aliquam ac, congue ac, vestibulum quis, felis. Aliquam non sapien.</p>
</div>

I've added a little padding to the columns just so the text isn't smashed up against each other.

CSS3 Way

<style type="text/css">
.columns {
-moz-column-count: 2;
-webkit-column-count: 2;
}
</style>

<div class="columns">
	<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla elementum accumsan mi. Maecenas id dui a magna tempor pretium. Quisque id enim. Proin id tortor. Curabitur sit amet enim vitae quam pharetra imperdiet. Nulla diam ante, pellentesque eu, vestibulum non, adipiscing nec, eros. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Duis a nunc. Donec non dui a velit pulvinar gravida. Nunc rutrum libero vel tortor. Duis sed mi eu metus tincidunt ullamcorper. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In purus lorem, aliquam ac, congue ac, vestibulum quis, felis. Aliquam non sapien.</p>
	<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla elementum accumsan mi. Maecenas id dui a magna tempor pretium. Quisque id enim. Proin id tortor. Curabitur sit amet enim vitae quam pharetra imperdiet. Nulla diam ante, pellentesque eu, vestibulum non, adipiscing nec, eros. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Duis a nunc. Donec non dui a velit pulvinar gravida. Nunc rutrum libero vel tortor. Duis sed mi eu metus tincidunt ullamcorper. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. In purus lorem, aliquam ac, congue ac, vestibulum quis, felis. Aliquam non sapien.</p>
</div>

There are a handful of other CSS3 column properties that you can apply, but for demonstrative purposes, I only specified the number of columns. If you'd like to learn more about these other properties, check out the multi-column page at CSS3.info.

View the demo.

10. Border Image

Border Image

I had no clue about the border image property until I upgraded to Firefox 3.5 and went to Chris Spooner's website and saw that his post images had image borders. I personally don't have any interest in this property, but that's not going to stop me from explaining how to achieve it.

Classic Way

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.borderImage.js"></script>
<script type="text/javascript">
$(function(){
	$('.classic .box').borderImage('url(images/border.png) 27 27 27 27 round round');
});
</script>
<style type="text/css">
.box {
border-width: 20px;
}
</style>

<div class="box">
	<!--CONTENT-->
</div>

Instead of spending the time creating multiple divs and repeating the background image around the div, I found a jQuery plugin that does the work for me. It's called borderImage and works just like it should.

CSS3 Way

<style type="text/css">
.box {
border-width: 20px;
-webkit-border-image: url(images/border.png) 27 round;
-moz-border-image: url(images/border.png) 27 round;
border-image: url(images/border.png) 27 round;
}
</style>

<div class="box">
	<!--CONTENT-->
</div>

As you can see, the border image property is a bit odd. W3 explains how it gets calculated MUCH better.

View the demo.

11. Animations

Animations

Alright, who doesn't love to see some element gently slide to the left or fade in when you hover over something? Animations are great to increase user interface, but make sure that you don't go over board! The only browsers that support CSS3 animations are Webkit based browsers. The only other way to display animations is to use JavaScript. I'll be using jQuery because it's my favorite JavaScript library (if you haven't guessed by now).

Classic Way

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
	$('.box').hover(function(){
		$(this).stop().animate({
			top: '20px'
		}, 300);
	}, function(){
		$(this).stop().animate({
			top: '0'
		}, 300);
	});
});
</script>
<style type="text/css">
.box {
position: relative;
}
</style>

<div class="box">
	<!--CONTENT-->
</div>

CSS3 Way

<style type="text/css">
.box {
position: relative;
-webkit-transition: top 300ms linear;
}
.box:hover {
top: 20px;
}
</style>

<div class="box">
	<!--CONTENT-->
</div>

Both of these code snippets do the same thing: slide the div 20 pixels down over the course of 300 ms. Remember, the CSS3 code only works in Webkit browsers!

View the demo.

Conclusion

There you have it: 11 CSS techniques that will become much easier with CSS3 in the (hopefully near) future. Obviously, it'll be a while before we can 100% depend on these properties across all browsers.

Don't forget to review these other Nettuts+ tutorials that discuss CSS3:


Related Posts

Check out some more great tutorials and articles that you might like

Enjoy this Post?

Your vote will help us grow this site and provide even more awesomeness

Plus Members

Source Files, Bonus Tutorials and
More for $9 a month for all TUTS+
sites in one subscription.

Join Now

User Comments

( ADD YOURS )
  1. PG

    Robin Drost September 8th

    Very nice post, really made some points more clear to me :)

    ( Reply )
  2. PG

    Amber Weinberg September 8th

    Awesome points, can’t wait until you only have one rule to type, instead of multiples for each browser

    ( Reply )
    1. PG

      Kevin September 8th

      We’ll be waiting a long time for that to happen.

      ( Reply )
      1. PG

        Abhijit September 9th

        Yes, especially MSIE should take another 5 years to implement CSS3

  3. PG

    IgnacioRV September 8th

    I have read the other posts here covering CSS3 techniques and this comparation between versions was needed ^^

    I’m sure a lot of people will leave comments like why bothering about this kind of web standars if they won’t be available in the near future… but I believe it’s important to spread the word so that more people will want to use or ask for them… maybe that way all browsers will implement this standars (dreaming is free, isn’t it? xD )

    Anyway, thanks for the tutorial!

    ( Reply )
  4. PG

    bmsorg September 8th

    What’s the best way to begin implementing these while still making sure things work across all browsers? Doing both, the classic and CSS3 way?

    ( Reply )
  5. PG

    Dan September 8th

    Some of your examples do not work with Firefox 3.5

    ( Reply )
    1. PG

      Dee October 7th

      Doesn’t work in Firefox 3.0 nor in IE 7

      ( Reply )
  6. PG

    Kevin September 8th

    CSS3 is great, I just wish all browsers used the same render engine and employed the same CSS methods as each other. Take rounded corners. In CSS3 you can use the example above, however IE doesn’t employ it (even v8!) so why would I use the CSS3 method? I won’t. As a developer I have to cater for the wider spectrum of users.

    ( Reply )
    1. PG

      Mike September 8th

      This is the same thing everyone says, nothing new.

      It’s up to the designer and the developer to decide if rounded corners are necessary for 100% of the users. If it is, then using the “classic” method is the way to go. If it is not, then css3 is the way to go.

      E.g. Rounded corners on your comments box may not be necessary for 100% of the users, so throw some quick css3 rounded corners in for the users who can appreciate it, otherwise, gray rectangles for the others.

      ( Reply )
      1. PG

        Kevin September 17th

        I believe you should design sites that appear 100% across all browsers as to deliver consistent content. It’s the finer details like rounded corners that make the difference and usual public members notice the difference too, albeit sub-consciously.

      2. PG

        Acaeris December 15th

        As you can’t possibly show rounded corners on all browsers that visit your website it will only ever be progressive enhancement so I see no reason to not start using CSS3 methods for it.

    2. PG

      Juan C Rois September 8th

      Your absolutely right, but wouldn’t it be nice if somehow IE would just fade into oblivion same as Netscape did. We can only dream about it.

      ( Reply )
    3. PG

      Michel September 8th

      my opinion is that sites don’t have to look the same on all browsers. if you really think that those rounded corners change the feeling the website creates then ok, stick to crossbrowsing methods, but otherwise that’s really a minor downside.
      It’s sort of progressive enhancement. You provide the best experience for modern browsers and you still give a fully functional site to IE.

      it also depends on the project and your audience.

      ( Reply )
    4. PG

      Ike September 8th

      I have not played around much with CSS3, but I do believe the rounded corners degrade nicely in those browsers that can’t display it. I don’t see a problem using it, and giving those that DO use a modern browser a little extra eye candy to make their browsing a little more enjoyable.

      ( Reply )
  7. PG

    John September 8th

    Its a shame that non of it is working in IE 8, so we still have to provide extra stuf for those out there using that browser

    ( Reply )
  8. PG

    Mike T. September 8th

    Wait, shouldn’t this be called 11 techniques that can be achieved using modern JavaScript and CSS2 done natively with CSS3?

    I’m not so sure about the ‘classic’ title.

    ( Reply )
    1. PG

      Tutorial City September 8th

      agreed

      ( Reply )
    2. PG

      Vasili September 8th

      I had originally written the article (well, about half it) without using any JavaScript, but it was life draining. The drop shadows are a pain to try and create using CSS2! ;)

      ( Reply )
    3. PG

      Thibaut Allender September 8th

      ditto

      ( Reply )
  9. PG

    Yasin September 8th

    I try all these but the are not working some on firefox and most of these on IE not supported.

    Please solve at least rounded corner property with css or javascript technique that is fully supported on IE

    ( Reply )
  10. PG

    Daniel September 8th

    Nice post indeed, good work. :D

    ( Reply )
  11. PG

    Eric B. September 8th

    It’s great to get these tips right now! I just started working on a Wordpress theme using CSS3.

    ( Reply )
  12. PG

    Juan C Rois September 8th

    Very nice tutorial, I love the way things are getting a little less complicated, don’t get me wrong I love jQuery and and Photoshop but CSS3 is definitively going to make a developer’s life much easier.
    I have not done any research as to when will it become an official standard, hopefully very soon! Also HTML5.

    Thanks for the tut Vasili.

    ( Reply )
  13. PG

    David Moreen September 8th

    I can’t wait until all this is standardized and I can start using it!

    ( Reply )
  14. PG

    Karl September 8th

    Thanks for the tutorial. What would also be very helpful would be to state in which browsers these work at present. It’s nice to look forward to the future (and in some ways we’re moving forward with the ‘death’ of IE5 and soon IE6) but if everyone else is like us, they want it now!

    ( Reply )
  15. PG

    Shane September 8th

    Interesting angle on CSS3 – we’ve had some articles on CSS3 before, but it’s good to see just how much easier some things will be. Now, for uniform browser support… :)

    ( Reply )
  16. PG

    ncus September 8th

    oh my god! This is super help for my personal site. Thanks for plenty of heads up there. I need to re read my CSS3 documentation skill.

    ( Reply )
  17. PG

    Merxhan September 8th

    Best Article ever written, neat and useful

    ( Reply )
  18. PG

    Nikola September 8th

    Good article, I learned a few things reading it. Thanks Vasili…

    ( Reply )
  19. PG

    Kasper September 8th

    nice post, thx

    ( Reply )
  20. PG

    Nori Silverrage September 8th

    Nice article. Gives me some nice things to look forward too. However, I don’t know if I would want to use the css animate property over the jQuery animate one as I think that animations like this example should be javascript or flash. But thats my opinion.

    ( Reply )
  21. PG

    Drew September 8th

    A very well laid out article Vasili. While we can’t implement many of these in most of our projects yet, I have begun to use a few properties such as a very light box-shadow or something of that nature as to compliment users with more advanced browsers.

    Thanks again!

    ( Reply )
  22. PG

    Wez Pyke September 8th

    Great article, well written and easy to understand.

    ( Reply )
  23. PG

    Kent September 8th

    Great article, though it pains me to think of all of the time put into hacks and trickery over the last few years to accomplish these results.

    ( Reply )
  24. PG

    Michel September 8th

    good techniques to share! it’s time we start moving forward and use this stuff. on my blog I already use @font-face, columns, word-wrap, rounded corners and aother couple of stuff, but I’m looking forward to try rgb colors and opacity in new projects.

    css3 rules make coding easier and websites looking better!

    ( Reply )
  25. PG

    crypta September 8th

    just what i need, ,thx

    ( Reply )
  26. PG

    Darren September 8th

    I took a look at the Envato website as you suggested and the first thing that struck me was that it’s impossible to read some of the white links, eg, ‘Meet our Websites’, ‘About Envato’, etc. when they are placed over white circles. Maybe some text shadow wouldn’t go astray there? Readability fail.

    ( Reply )
  27. PG

    Ryuichi Nonaka September 8th

    nice technic. thank you.

    ( Reply )
  28. PG

    MushTools September 8th

    nice techniques! thanks

    http://www.mushtools.com | resources for designers

    ( Reply )
  29. PG

    Gent September 8th

    Props for taking the time and energy to write this. But I’m getting a bit tired of these CSS3 and HTML5 articles about how easy it is to do things. It’s like “see how easy it is in CSS3…. now all you have to do is include all the nonsense I just showed you how to do away with because no browser supports all this yet.” The examples that illustrate my point best is opacity and radius properties.

    Although it lacks any content, working links, etc… I plan on making my current site’s latest incarnation only standard CSS2/3 no proprietary opacity stuff… no -moz-radius or -webkit-radius… it will inevitably run a browser check and demand all visitors upgrade their browser to the latest and most standards compliant versions of firefox, safari, opera… period. The game has gone on long enough – thankfully my site is not a source of income, but a hobby/side project.

    ( Reply )
  30. PG

    paul September 8th

    When should we start implement css3, when will it be standardized,

    ( Reply )
  31. PG

    iFadey September 8th

    I was using some of these techniques but I didn’t knew that these belongs to CSS3 :P
    Now I really understand what is from CSS3 and what’s not. Very nice post :)

    ( Reply )
  32. PG

    scvinodkumar September 8th

    Its a great work. Thanks

    ( Reply )
  33. PG

    Ejaz Ahmad September 8th

    nice post regarding CSS3 … are these all applicable on IE6

    ( Reply )
  34. PG

    Stephen Webb September 9th

    As someone who is still relatively new to CSS and still learning it’s possibilities I was surprised by just how flexible the next version appears to be! I haven’t heard much news about CSS 3 or its development, so I’m now looking forward to the design possibilities it will present. I imagine the page sizes, and therefore loading times, will be greatly reduced with the usage of code as apposed to image files.

    With the standardisation of CSS 3, and also the imminent introduction of HTML 5, will Internet Explorer likely be updated to read and display sites in a standardised format? The additional time and effort required just to make sure IE displays pages as required is a burden on all designers, and surely this cannot continue into another generation of the webs development.

    ( Reply )
    1. PG

      Kevin Quillen September 9th

      no

      ( Reply )
  35. PG

    Ivan Mišić September 9th

    Great article, ncie, usefull, can’t wait to test some CSS3 on my web site

    ( Reply )
  36. PG

    paadt September 9th

    not bad, but those example images are almost pointless!

    ( Reply )
  37. PG

    Lucian E. Marin September 9th

    Your CSS3 is written wrong. The specific browser tags should be first and W3C’s should be the last ones. Even more, when you use the transparent background color you should also add a fallback (an opaque background).

    ( Reply )
  38. PG

    phil September 9th

    thx…

    ( Reply )
  39. PG

    Ricardo "mAiN_iNfEcTiOn" Machado September 9th

    Nice article.

    Really good explanations about the (obvious) improvements of CSS3 on Web-Development…

    But, still… We’ll have to wait for all browsers to support in order to apply css3 to them…

    ‘Till then, what you can do is check if the user-agent supports CSS3 and then load CSS3 stylesheet… If it doesn’t, then, load css2.x stylesheet…

    ( Reply )
  40. PG

    Ijaas September 9th

    lol those demos are really bad even the “classic ways” dont work cross browser.

    ( Reply )
  41. PG

    Matt September 9th

    OK, this post is really great- especially that IE is still not supporting CSS3, so these “Classic Way” stuff will also be useful.
    Thanks!!

    ( Reply )
  42. PG

    yogsototh September 9th

    My website (yannesposito.com) use almost all of them :-) .

    Drop shadows, transparency, text-shadow and rounded corner.

    It works on Safari and Firefox 3.5. For other browser I’ll make my website minimal. As it already is for Internet Explorer.

    It is not really a big problem these feature are not working on many browser.

    ( Reply )
  43. PG

    Kevin Quillen September 9th

    The only thing people really care about are columns, lets be honest. And on that note, we can’t effectively use any of this on projects until all major browsers support it.

    ( Reply )
  44. PG

    Kevin Quillen September 9th

    I also forgot to say how its weird you consider the ‘classic’ way is jQuery + jQuery plugins + some CSS2. Most of these don’t need javascript.

    ( Reply )
  45. PG

    David Steinsland September 9th

    It’s not a “classic CSS technique” if you use jQuery to make it. Then it’s a classic jQuery technique.

    By the way, none of the “new” ways worked for me. I’m using Opera 10, so it’s not as “easy” as you states.

    ( Reply )
  46. PG

    Caroline M September 9th

    I’ve just tested this in the new Opera 10, and unfortunately it appears most of both methods dont work!

    ( Reply )
  47. PG

    Egg Web Design Cork September 9th

    Wow, exciting stuff! Pity about ie compatibility issues etc. Will take a while but will be worth the wait.

    ( Reply )
  48. PG

    DesigningMall September 9th

    superb post. i also believe that CSS3 is going to handle some technical issues easily.

    ( Reply )
  49. PG

    Yigit Ozdamar September 9th

    Great article! Thanks…

    ( Reply )
  50. PG

    Alan September 9th

    I would think the writers of these articles would actually test on major browsers and give pass/fail results.

    It’s completely pointless to make a list of the ‘new’ CSS3 techniques that only work in one browser. It would also give some people a little more heads-up before rushing out and using any of these techniques. A simple test in IE 6-8, FF 2 & 3, Safari and Opera would be easy enough and would go a long way.

    ( Reply )
    1. PG

      Briggs September 9th

      I agree, none of these “new” ways work for me on Firefox 3.

      ( Reply )
  51. waiting for full supported in all browsers.

    ( Reply )
  52. PG

    James Ballard September 9th

    The jquery solutions are quite simple actually. Crazy that CSS3 has made them simpler. Too bad IE still exists.

    ( Reply )
    1. PG

      Kevin Quillen September 10th

      jQuery isn’t even necessary in most of those cases. So okay, you build your site with CSS driven by javascript, that all falls apart if their JS is disabled for whatever reason.

      ( Reply )
  53. PG

    axomedia September 10th

    A kick-butt CSS3 overview, thank you!

    ( Reply )
  54. PG

    Marlou September 10th

    Thanks for this post!
    I have a question about @font-face though:
    Since you’re uploading and using this font file from your webserver, everyone is able to download the font-file. Is there a way to avoid this?

    ( Reply )
  55. PG

    Szabolcs Bakos September 10th

    Love it!

    ( Reply )
  56. PG

    Pseudoclass September 10th

    A “rotation” rule would be on my wish list. Imagine taking any element on the page and giving it a positive or negative rotation value and x and y coordinates for the rotation point:

    .box {
    rotate: -45 24 10;
    }

    Oh well maybe for CSS 4 ;)

    ( Reply )
  57. PG

    Sam September 10th

    I love your Tutorials I learned everything I know from this site. Love it

    ( Reply )
  58. PG

    NatalieMac September 10th

    Developers and designers – keep in mind that these techniques are just eye-candy techniques. While nice eye-candy can definitely enhance a design and add personality and depth, it’s by no means necessary to access the content of the web site. Whether or not you can make use of these techniques will depend on the site, the purpose, the client, and the browser statistics for that particular site.

    I’ve already worked on sites where it was acceptable for IE visitors to not see rounded corners. And I’ve worked on sites where that wasn’t acceptable to the client or advisable based on the proportion of site visitors using IE. You have to take things on a case-by-case basis.

    Just keep in mind, whether or not a box has rounded corners or multiple background images or border images or a transparent background or a drop shadow has nothing to do with the site visitor’s ability to view the content in that box. All of these methods degrade gracefully for IE and older browsers so you don’t have to worry about the site falling apart. As long as you’re aware of the trade-off and they’re acceptable to you and/or your client, go ahead and use the CSS3 methods now – you’ll just be that much further ahead of the curve.

    ( Reply )
  59. PG

    brad September 10th

    @font-face works in IE as long as you convert the fonts to EOT fonts with the tool Microsoft supply’s. (Microsoft WEFT). At least that’s something.

    E[att$="string"] {property: value;} where E is a selector. works in all browsers(not covered in article)

    Multi Columm Layouts work in Firefox and Safari.

    Rounded corners in Webkit and Gecko-based browsers

    I say look at what works where and use them. They all degrade well.

    ( Reply )
    1. PG

      Silver Firefly January 12th

      Too bad WEFT doesn’t play well with Vista.

      ( Reply )
  60. PG

    Matthew Hunt September 10th

    This article is missing css gradients:

    http://webkit.org/blog/175/introducing-css-gradients/

    -webkit-gradient property

    ( Reply )
  61. PG

    tutorial blog September 12th

    Thank your post.
    Can I post your articles in my blog?
    http://tutorialblog.info.
    Thank

    ( Reply )
  62. PG

    Oskar Krawczyk September 14th

    RGBA can be achieved with no Server Side scripting.

    Rgba() for modern browsers and progid:DXImageTransform.Microsoft.gradient() for IE.

    Know your audience.

    ( Reply )
  63. PG

    Gordejev September 15th

    Thank you for useful information.
    CSS3 Cool.

    ( Reply )
  64. PG

    Erwin Heiser September 15th

    Nice article, but it’s a bit weird to call Cufón a “classic” technique.
    A classic technique for text replacement would be SIFR or plain old image replacement through CSS.
    Also, please stop whining about “it doesn’t work in X browser”, if we as developers/designers don’t push the envelope, who will?

    ( Reply )
  65. PG

    Timo Körber September 15th

    great article… very good to get the know the new techniques…

    ( Reply )
  66. PG

    Surendra September 16th

    It’s useless until it works with IE8. Bcoz still IE users are more than Firefox, safari & chrome.

    ( Reply )
  67. PG

    Imad Mouaddine September 16th

    Thanks I love your article

    ( Reply )
  68. PG

    Edward September 17th

    Great work. Thanks.

    ( Reply )
  69. PG

    Sido webdesign September 17th

    Très très utile comme d’habitude !

    ( Reply )
  70. PG

    alex September 17th

    -webkit-background-size:
    -o-background-size:
    -khtml-background-

    its not css3 idiot!

    ( Reply )
  71. PG

    Jermaine Young September 17th

    This was very very helpful. I can’t wait till all the other browser adopts these properties.

    ( Reply )
  72. PG

    Mohamed Almasry September 17th

    Mozilla borders were covered even before CSS3, What you don’t know it’s a browser specification not a standard feature or attribute .

    ( Reply )
  73. PG

    Rohit Verma September 19th

    I am facing problem in the fancy font style in the css3 property will you help me

    ( Reply )
  74. PG

    spasquini September 21st

    I don’t know if a permission has been accorded but a full copy of this article has been published here: http://tutarchive.com/2009/09/11-classic-css-techniques-made-simple-with-css3/
    With no link-backs.

    ( Reply )
  75. PG

    alsd September 22nd

    what is this?
    -o-background-size: 50%; /* Opera */

    I don’t believe Opera supports this.

    ( Reply )
  76. PG

    Ankur Gupta September 22nd

    Can we embedd ttf files come with Ubuntu/Other Linux? I am asking this because They are open source software.

    ( Reply )
  77. PG

    Sumit Kumar September 22nd

    Excellent article..very useful..

    ( Reply )
  78. PG

    LazyBytes September 26th

    Great Article, and very usefull!

    cheers :)

    ( Reply )
  79. PG

    craig September 30th

    We can use these in real world only when IE went totally bankrupted.

    ( Reply )
  80. PG

    Brandon S. Adkins October 2nd

    Yay! More stuff we can’t use yet!
    :|

    ( Reply )
  81. PG

    MrSuitUp October 17th

    Didn’t know about the font part,
    the near future seems bright!

    ( Reply )
  82. PG

    umesh October 24th

    this is very useful Article. Excellent job!

    Thanks.

    ( Reply )
  83. PG

    Nathan October 29th

    Wow.
    Very nice post and very useful.

    Thanks.

    ( Reply )
  84. PG

    rdam October 29th

    the Rounded Corners and many others doesn’t work with Internet Explorer! too bad, 70% of people use IE, is not very useful

    ( Reply )
    1. PG

      Silver Firefly January 12th

      70% of people do not use IE. That’s outdated information.

      ( Reply )
  85. Nice post :)

    ( Reply )
  86. PG

    mrak911 November 16th

    Very nice post.Excellent job!

    ( Reply )
  87. PG

    David Bixler November 28th

    Having a few issues with rounded corners and shadows and such…

    I can’t get Mozilla to even recognize it, and IE simply will not render the rounded bits. Help?

    ( Reply )
  88. PG

    loving December 6th

    well i like that but the problem is i want to know Why u addd the damm css in index? see this

    ol {
    font: italic 18px/20px Georgia, Serif;
    color: #888;
    }
    ol li {
    padding: 5px 6px;
    border-top: 1px solid #fff;
    border-bottom: 1px solid #eee;
    }
    ol li:hover {
    background: #f9f9f9;
    }
    ol li a {
    font: 12px/20px Arial, Sans-Serif;
    color: #222;
    }

    ( Reply )
  89. PG

    Jim Pannell December 9th

    Fantastic article Vasily – thanks! Really loving how adding a little CSS3 goodness can transform a great design into a fantastic one :-)

    ( Reply )
  90. PG

    Jim Pannell December 9th

    Fantastic article Vasily – thanks! Really loving how adding a little CSS3 goodness can transform a great design into a fantastic one :-)

    ( Reply )
  91. PG

    Panchito December 12th

    gracias chato, me gusto mucho mucho mucho :)

    ( Reply )
  1. Arrow
    Gravatar

    Your Name
    December 12th