July 3rd 2009 by Peter · 7 comments
Enhancing Your Site with WebKit
WebKit is an open source browser engine. Apple uses WebKit in Safari, Mail, and other applications. Google’s Chrome browser, along with the S60 browser and the iPhone browser, is also built on WebKit. Some of the cool features of WebKit is transitions and transforms. With purely CSS you can create stunning animations. Your site will still work in other browsers, but the users with WebKit browsers will just get a slightly better experience.
Take for example Elliot Jay Stocks’ new website, elliotjaystocks.com. It is in it self a very beautiful website, but if you open it in e.g. Safari 4, it’s even more beutiful. When you hover your mouse over the images, the border will slowly fade into a lighter color. In non-WebKit browsers, it’ll just be a very sudden transition. This done solely by CSS.
Another example is Atebits’ website. Atebits is the company behind the Twitter app Tweetie. Let’s have a look at their front page:
That’s just beautiful, huh? Well, let’s dive into how we easily can add similar function to our own site.
The first property we have to learn is -webkit-transition. The -webkit-transition property is a shortcode for the three properties -webkit-transition-property, -webkit-transition-duration and -webkit-transition-timing-function.
We’ll probably learn this the best by having a look at an example, so here goes: We want to create a div that, when hovered, fades into another color. Here’s the code:
div { -webkit-transition: background-color, color 0.4s linear; background-color: #777777; } div:hover { background-color:#999999; }
And here’s the example:
This wasn’t so hard, was it? Now let’s move on to using the -webkit-transform property. It allows you to scale, rotate, translate, and skew the object. It even allows you to use matrices for advanced transformations. Let’s try to rotate and skew the div from before:
div { -webkit-transition: all 0.4s linear; background-color: #777777; } div:hover { -webkit-transform: scale(1.3) skew(3deg); background-color:#999999; }
This is just a little glimpse into what you can do with WebKit. Hopefully, you’ll find it useful.
i55iqj8amt









Thanks that is very unique post. Never heard about it
nice post, thanks! keep posting…
Wow.. That’s really neat; I’ve never seen these effects done by CSS before, just jQuery and JavaScript. I’d love to eventually use them – perhaps in the future. The skew is especially neat.
Hi there,
Thank you for the nice comments and suggestions. For your pleasure, I have removed the text shadowing in the body text. On my screen it was not an issue, but I sure don’t want anyone to not to be able to read the articles, so thank you very much.
Nice article! Thank you for it. A little suggestion for your website. Everything looks pretty sweet ind here, the only problem for me, is actually reading the content of your page. The text shadow declared in nizzle.css : text-shadow: 0 1px 1px #555555 on line 19 makes it really complicated for me, at least with this monitor, to read the text. Maybe the contrast is just not high enough. Just my 2 cents. Keep on blogging.ffffffffffff
Cool, some nice effects there. I’m having some trouble with your text shadow on the body copy of your site though, it makes reading the text harder.
I’m stunned!
I’ve never seen these effects before!! It works also on Chrome effectively. I think this is something I’ll be using on my future project
Thanks!