Free up your time and revolutionize your design with simple web development.

6 Webkit Tricks to Easily Create Stunning iPhone Web Designs

Posted: July 21st, 2009 | Author: Kurt | Filed under: Web Design | 6 Comments »

Picture of a iPhone for Webkit inspiration

Webkit is the display engine created by Apple to render pages in Safari on OS X and the iPhone. Like Firefox, it has a series of specific CSS properties you can use to design pages for Mac or iPhone. Unfortunately, though, there isn’t much documentation on the web about Webkit. So, here’s a list of six Webkit properties you can use for your next iPhone or Mac website. Remember, these don’t work on any other browser, so I wouldn’t recommend using them for a PC-oriented website without CSS hacks or IE fallbacks.

Webkit Tricks for iPhone Sites

1. Create Simple Reflections Without Javascript

-webkit-box-reflect: direction offset mask-box-image;

Webkit Reflection
For direction, you can specify what side of the box you want the reflection to show up on. Valid options are above, below, left, or right. Offset is the distance between the beginning of the reflection and the end of the box. It can be a percentage or a measurement (like 5px). The mask-box-image property refers to an image used to mask the reflection.

2. Rounded Corners Without Images

I mentioned this in my post about reducing images with CSS.

-webkit-border-radius: 10px;

3. Easily Shadow Anything

You can add drop shadows to boxes, text, and images with the following Webkit property:

-webkit-box-shadow: hoff voff blur color;

Drop Shadow with Webkit

hoff and voff refer to the offset of the shadow. Change the width and opacity of the shadow with the blur setting.

4. Bring Back the <marquee>

Yes, you can bring back the class and sophistication of the scrolling marquee. Here’s the CSS property:

-webkit-marquee: direction increment repetition style speed;
  • direction specifies the direction of the marquee. left and right are valid directions.
  • increment is defined in measurements, and it tells Webkit how far to move the object each iteration.
  • repetition refers to how many times to repeat the marquee.
  • style describes how the marquee should move. You can use commands like alternate, none, scroll, or slide.
  • speed is how fast the marquee should move.

5. Outline Text with Webkit

-webkit-text-stroke: width color;

Create Text Outlines with Webkit

6. Create Crazy Tap Colors on iPhone

You can easily change the tap color of your buttons on the iPhone to create a nice custom effect. Here’s the code:

-webkit-tap-highlight-color: color;

Be sure to subscribe to Cherrysave for free by RSS or email to keep up with the latest design tips and tutorials.

Delicious
Bookmark this on Delicious


6 Comments on “6 Webkit Tricks to Easily Create Stunning iPhone Web Designs”

  1. 1 zabox.net said at 12:51 pm on July 21st, 2009:

    6 Webkit Tricks to Easily Create Stunning iPhone Web Designs – Cherrysave…

    Webkit is the display engine created by Apple to render pages in Safari on OS X and the iPhone. Like Firefox, it has a series of specific CSS properties you can use to design pages for Mac or iPhone. Unfortunately, though, there isn’t much documentatio…

  2. 2 tekkie said at 7:50 pm on July 21st, 2009:

    And the above is far from all. You can also use:

    Web Fonts
    Transforms
    Transitions
    Text shadows of CSS 3, see W3C Text Module on that one

    Safari, that runs on the WebKit engine, was also the 1st Acid3 compatible browser.

  3. 3 Fabian Pimminger said at 10:22 am on August 24th, 2009:

    How is this theme in the image called?

  4. 4 Ghostly Compatibility: Cross Browser Transparancy with CSS - Cherrysave said at 11:39 am on September 8th, 2009:

    [...] CSS3 allows for a full range of effects (I’ve written some tips for CSS3 web and iPhone development), including transparency, the new selectors aren’t always compatible with a large variety of [...]

  5. 5 iPhone Web App Resources | Ash White – MIST7500 said at 10:02 pm on November 5th, 2009:

    [...] 6 Webkit Tricks to Easily Create Stunning iPhone Web Designs [...]

  6. 6 Ghostly Compatibility: Cross Browser Transparancy with CSS « Versus lab’s said at 6:31 pm on December 10th, 2009:

    [...] CSS3 allows for a full range of effects (I’ve written some tips for CSS3 web and iPhone development), including transparency, the new selectors aren’t always compatible with a large variety of [...]


Leave a Reply