6 Webkit Tricks to Easily Create Stunning iPhone Web Designs
Posted: July 21st, 2009 | Author: Kurt | Filed under: Web Design | 6 Comments »
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;
![]()
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;
![]()
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;
directionspecifies the direction of the marquee.leftandrightare valid directions.incrementis defined in measurements, and it tells Webkit how far to move the object each iteration.repetitionrefers to how many times to repeat the marquee.styledescribes how the marquee should move. You can use commands likealternate,none,scroll, orslide.
speed is how fast the marquee should move.
5. Outline Text with Webkit
-webkit-text-stroke: width color;
![]()
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.
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…
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.
How is this theme in the image called?
[...] 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 [...]
[...] 6 Webkit Tricks to Easily Create Stunning iPhone Web Designs [...]
[...] 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 [...]