CSS3 is probably one of the coolest things to hit the web design scene since, I don’t know, HTML5. And here’s why: CSS3 has a lot of new features that simply take web site styling to the next level.
With CSS3, web browsers natively produce a lot of the styling effects that were once only achievable through creative HTML hacks and images editing programs like Photoshop. What’s great about CSS3 is that it’s good at reducing the amount of image files and code you have to place on your site as part of your design. This means reduced server requests and load times for your website. That precious bandwidth…
Also, when you want to edit the design on your website, changing a few lines of CSS is much, much easier and less time consuming than having to opening up Photoshop and edit old graphics. You might even have to recreate graphics from scratch to fit a new design. On the other hand, resizing an element, changing the border radius, changing colors and gradients, these are all things that take a few seconds to change in CSS.
Finally, using CSS3 just makes it easier to achieve most of the design aspects on a website. You can accomplish a lot with a little code, leaving you more time to listen to music and hang out with friends.
Here are my top 5 favorite CSS3 features, along with a quick code implementation that you could stick in any HTML page:
You’ll usually find this effect used subtly to surround item containers on a webpage. Back in the day, the shadow had to be a separate image slice (or a few different images). With CSS3, you can now easily create a shadow around an element with some code, and be able to change the position, color, and blur of that shadow.
This is already very popular on the web. Honestly, rounded corners just look more user friendly than square boxes. Best part now is, you can apply this effect to HTML elements with CSS3. That’s good because you’ll find rounded corners almost everywhere. Twitter for example, takes the “Round ALL the corners!” approach.
You can add a shadow to HTML text that can then be highlighted, copied and pasted just like normal text. The old way involved typing the words you wanted in Photoshop, applying a drop shadow, and saving those words as an image file. But why use images when you can use just text? You can change the shadow angle, the shadow blur, and the shadow color in CSS. You can also check out this CSS3 generator to see how it works.
This property makes can make elements more see-through. You could go about setting the opacity of an image in an image editor, and then save it as a .png or .gif file with transparency enabled. Or you could just write one line of code in CSS. It’s up to you. The transparency value ranges from 0 (completely see-through) to 1 (completely solid).
Gradients created right in the browser as soon as you load the page? Cool! It’s another really popular effect that was accomplished by using images (plus some CSS actually) and can now be done solely with CSS3. Notice that this code will only work on specific Firefox, Chrome, and Safari browsers. This feature is not as widely supported on all browsers and you have to write separate lines of code for different browsers. The old way of doing gradients involved generating a thin gradient image and repeating it across the page. If you want to stick with the old way, you can use this gradient generator. If you want to try the new CSS3 way, try this resource. It generates a lot of that compatibility code for you.
The only real caveat of CSS3 is the fact that not all features are compatible in all browsers. CSS3 is constantly in development and browsers simply need time to catch up to all the latest features. However, the features mentioned above should work fine across the latest iterations of all the major browsers.
What do you think of CSS3? Let us know in the comments below.