Surfin’ Safari

Multiple Backgrounds

Posted by Dave Hyatt on Tuesday, August 2nd, 2005 at 4:32 pm

You may or may not have seen this blog post from the CSS WG asking for feedback on backgrounds and borders in CSS3. One of the features in the CSS3 draft is the ability to specify multiple backgrounds on a single element, thus allowing for effects like Sliding Doors to be achieved with only one element instead of two. Since people are snooping around in the WebCore code, I might as well reveal this now rather than later. :)

Safari 1.3 and 2.0 support multiple backgrounds as specified in CSS3.

Surprise!

I encourage web designers to try out the support, play with it, see if the syntax makes sense, and give the working group your feedback. This feature should be considered experimental in Safari, and we will update our implementation as necessary to match the CSS3 draft as it changes.

38 Responses to “Multiple Backgrounds”

  1. Dan Bedford Says:

    Holy crap this rules… ok, so I made a quick little page to try this out and I thought I’d share…
    http://petertoh.com/images/multi-bk.html (it’s not me in the images) :-)

    The best part is grabbing the corner and re-sizing the window all around checking out the layering. The layering works in the the order the images are in the CSS. Check out the source, the CSS is in the head.

    I lifted the syntax from the CSS3 working draft pages here:
    http://www.w3.org/TR/2005/WD-css3-background-20050216/#layering

  2. rendezvouscp Says:

    I’m trying to play around with the background property as I’m reading the CSS Backgrounds and Modules Working Draft. I’m not getting things to work out in the latest released version of Safari, or with the current WebCore, in Tiger. When someone has a working test page, I’d really like to see it in action. Thanks.
    -Chase

  3. rendezvouscp Says:

    And there’s my answer… Thanks!
    -Chase

  4. Dan Bedford Says:

    No doubt, rendezvouscp…

    I checked my page in all the browsers I could get my hands on, and Shiira 1.1 renders this correctly. I know it’s built on Webkit, but so is Omniweb, and it only renders the first layer. I guess Shiira actually uses the same framework as Safari does, and Omniweb doesn’t?

  5. Pingback from CSS3 Backgrounds en Safari @ 5.1.1.:

    [...] Safari 1.3 and 2.0 support multiple backgrounds as specified in CSS3..
    Que envidia.
    Safari 1.3 and 2.0 support multiple backgrounds as specified in CSS3..
    Que envidia. [...]

  6. Twist Says:

    Kind of cool but if you scroll down the page you will find the item that I have been wishing for for about 5 years now ‘box-shadow’. I did a quick test but it hasn’t been implemented in Safari yet. Looks like there is some really good stuff in CSS3 so far, ‘border-radius’ and ‘border-image’ are other ones I have been wishing for .

  7. Sören Nils 'chucker' Kuklau Says:

    “I guess Shiira actually uses the same framework as Safari does, and Omniweb doesn’t?”

    OmniWeb doesn’t use WebKit at all. The OMNI Group infrequently forks off WebCore and JavaScriptCore, then changes them to fit their needs, then integrates them to the next major OmniWeb upgrade. IIRC, OmniWeb 5.0 used versions forked off the Safari 1.1 backend, whereas OmniWeb 5.1 uses versions forked off the Safari 1.2 one. This is also the reason for rather severe performance differences between OmniWeb and WebKit-based browsers.

    OMNI’s explanation is that WebKit doesn’t give them enough flexibility; in addition, they like to use some of their own frameworks (which have been engineered since the early 90s, OMNI originally having been a NeXT company), such as their own networking/socket implementation.

  8. Brady J. Frey Says:

    The IE team says they won’t be Acid ready in two years… and then Safari starts implementing multiple backgrounds? I knew there was a good reason why we decided to shift our company all mac, bless you safari:)

  9. Todd Says:

    I’ve haven’t tried it for myself yet, but the example Dan posted works great. Thanks for letting us know about it. Hopefully we’ll see this in Firefox and others soon, too. I can see a lot of good uses for this feature.

    @Dan: OmniWeb bundles it’s own older version of WebKit. Look in the Frameworks folder in the OmniWeb app bundle. I believe this is so they can remain compatible with Jaguar, which would mean that they’re using the version of WebKit from Safari 1.2 (I think). Shiira uses the system version of WebKit.

  10. Pingback from shaunandrews.com » Whats the deal with Safari?:

    [...] Safari supports some experimental CSS3 with mutiple background images. Link [VIA] Needless to say, this is really cool. I can’t wait till this technique can be used in r [...]

  11. Chris Clark Says:

    Just set up another test page for your amusement, all.

  12. Dan Bedford Says:

    @Chris Clark:

    Much better test page! I’ll see if I can come up with a little something better with mine later on today. Shaun Andrews actually directly linked to my test page! (Not that I mind of course…) I need to step up my game if that’s the case. :wink:

    I may even try and implement this on the new petertoh.com website by redirecting Safari 1.3 and 2.0 users to the multi-background pages. It’s just too cool!

    @Webkit Team: Got anything else we can play around with?

  13. Dan Bedford Says:

    Surprise of the century….

    RealPlayer’s browser supports multiple background images as well.

    I checked my test page and Chris Clark’s test page, and the both rendered correctly. I was using version 10.0.0 (331).

    Oh, and thanks everyone for the info on Webkit and Omniweb!

  14. Pingback from CssDev ~ Andy Peatling on CSS and Standards » Multiple Backgrounds in Safari:

    [...] 3-8-2005 } Chief Safari developer David Hyatt revealed this week that both Safari 1.3 and 2.0 have the capacity to support multiple ba [...]

  15. Dan Bedford Says:

    Hello all… me again,

    I’ve updated my test page to be a sort of mini-tutorial about a great use for multi-background images. Check it out!

    Enjoy,
    Dan

  16. Robin Says:

    Dan, OT but even though you specify a meta content type of application/xhtml+xml your server’s still sending text/html which is overriding it. If you want to change it you’ll need to set this up on your server.

  17. Pingback from a.css, esbudellant estàndards » Múltiples fons mitjançant CSS3:

    [...] últiples fons mitjançant CSS3 05/08/05 Safari ha implementat a mode de prova múltiples fons en un sol element tal i com especifica l’esborrany de CSS 3 Backgroun [...]

  18. amonre Says:

    I threw up a quick demo page at http://amonre.org/pub/multiplebackgrounds/ . This demo uses 10 image to achieve the “window” look (I stole the theme from Kaleidoscope, in case you were wondering).

  19. Pingback from Il Filosofo » Internet Explorer 7 Beta Review: Part 1:

    [...] Glad it’s back.

    background-attachment: fixed;This is a CSS1 specification. While Safari is already including CSS3 draft features, IE7 doesn’t seem to get this handy CSS1 setting. T [...]

  20. Pingback from Stoneship - Multiple Backgrouns:

    [...] Miscellaneous - No comments

    Dave Hyatt recently wrote in Surfin’ Safari about WebKit’s support for multiple backgrounds. (Surfin’ Safari is the WebKit Open Source project [...]

  21. Pingback from davidhay » Blog Archive » Semantics vs Presentation:

    [...] ultiple background images, that’s hardly practical right now - I know of only Safari supporting multiple background images a [...]

  22. Pingback from RoyalTS » Blog Archive » Mehrere Hintergrundbilder:

    [...] versteckt sich in den Safari Versionen 1.3 und 2 ein Feature, das bisher unenteckt blieb. Die Entwickler haben, noch bevor der Standard überhaupt finalisiert wurde, schonmal Teile des CSS3 Backg [...]

  23. Gabriel Castro Says:

    You guys never cease to amaze me. This is amazing work!

    Does Safari 2.0 also support the background-clip and background-origin properties? I’ve been playing around with layering and either those properties are not supported yet or I don’t understand how they work (which is quite possible). What’s the verdict?

  24. hyatt Says:

    Not supported yet, but will be soon.

  25. cirrus Says:

    Thank you so much Safari team!
    This is such a useful feature and something I’ve been longing for for a long time!

    Like many of the previous posters I’ve put also together a test page, so if you haven’t seen enough fancy boxes here’s another one: http://event-horizon.twiddles.com/sites/experimental/css3-bg/ :P

    Enjoy!

  26. Gabriel Castro Says:

    Thanks Dave! Looking forward to the next (official) version of WebKit. It will certainly make for some nice Proteus and Adium themes.

  27. Pingback from kk-works.de » CSS 3 schon heute:

    [...] einmal etwas über die verschiedenen Neuerungen in CSS 3 gelesen haben. Heute habe ich nun gelesen, dass es auch derzeit schon möglich ist verschiedene Sachen auszuprobieren. mehrerer Hintergrün [...]

  28. Pingback from kk-works.de » CSS 3 schon heute:

    [...] einmal etwas über die verschiedenen Neuerungen in CSS 3 gelesen haben. Heute habe ich nun gelesen, dass es auch derzeit schon möglich ist verschiedene Sachen auszuprobieren. mehrerer Hintergrün [...]

  29. Pingback from Minid.net » Blog Archive » Soporte de múltiples fondos y bordes en Safari 1.3 y 2.0:

    [...] ó algo que para mí es de suma importancia. Comentó que, tanto el Safari 1.3 como el 2.0 tr [...]

  30. Pingback from Roblog » Blog Archive » Safari support for multiple backgrounds:

    [...] « Lots of things. Safari support for multiple backgrounds Straight from the horse’s mouth comes the news that dev releases of Safari 1.3 and 2.0 now support [...]

  31. MIND Justin Says:

    I wrote a quick tutorial on this: Multiple Backgrounds (CSS3)

  32. Pingback from Broken: Banana Republic « davejlowe.com:

    [...] a pit of despair when it comes to web standards, and Safari works just fine with AJAX and leads the industry on some features of CSS. Well, anyway, Jeff Veen says it much better than I do. [...]

  33. Pingback from Browser World » The State of the Browsersphere:

    [...] ties of WebKit so that other web-related OS X applications can reap the benefits as well. Multiple background support has been added, as specified in CSS3. This effe [...]

  34. Pingback from Max Design - standards based web design, development and training » Blog Archive » Some links for light reading (21/8/05):

    [...] ccessibility with Firefox Zoom layout starter kit Automated testing - How useful is it? Safari supports multiple background images Excellent multiple background image demo Architecting CSS D [...]

  35. Pingback from Photo Backgrounds » Surfin Safari - Blog Archive Multiple Backgrounds:

    [...] ltiple Backgrounds Filed under: General — Admin @ 1:59 am Surfin Safari - Blog Archive Multiple Backgrounds Safari 1.3 and 2.0 support multiple backgrounds a [...]

  36. Pingback from Photo Backgrounds » Surfin Safari - Blog Archive Multiple Backgrounds:

    [...] ltiple Backgrounds Filed under: General — Admin @ 7:10 am Surfin Safari - Blog Archive Multiple BackgroundsPingback from Photo Backgrounds Surfin Safari - [...]

  37. Pingback from shepherdweb.com » Safari Bugs (Bring on OS 10.5 Leopard) » Shane Shepherd: web design and development; music:

    [...] i release. Safari was the first browser to pass the Acid2 test, to support CSS3 Specs like multiple background images and CSS2 text-shadow. While I’m glad that the Safari developers are dedicated to [...]

  38. Pingback from Ajax Performance » In defense of Ajax for the iPhone:

    [...] iPhone apps will not have the look and feel of native code. However, Safari has long provided CSS3 features and enhancements to provide fine control of the presentation layer. This functionality was long [...]