Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Mar 2008
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Mulltiple Background Images

    Hi , i have a question about applying background using CSS.
    Is there a way to put multiple background images on one div tag ? one for the top , one for the bottom and one for the rest using css only ?
    Each time that i want to do it i use tables and i'm not so sure that this is
    the proper way ...

  • #2
    Regular Coder
    Join Date
    Sep 2007
    Location
    AZ, USA
    Posts
    685
    Thanks
    6
    Thanked 46 Times in 46 Posts

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,624
    Thanks
    6
    Thanked 1,001 Times in 974 Posts
    It’s supposed to be possible in CSS 3 but until that’s out and all browsers support it a lot of water will have flowed under the bridge. So the short answer is: no.
    Last edited by VIPStephan; 05-20-2008 at 02:06 AM.

  • #4
    Senior Coder Arbitrator's Avatar
    Join Date
    Mar 2006
    Location
    Splendora, Texas, United States of America
    Posts
    3,300
    Thanks
    28
    Thanked 275 Times in 269 Posts
    Quote Originally Posted by RisTar View Post
    Is there a way to put multiple background images on one div tag ? one for the top , one for the bottom and one for the rest using css only ?
    Yes, there is a way to do this per the CSS3 Backgrounds and Borders module drafts [1] [2]. However, insofar as I’m aware, that part of the draft is only supported in Safari 3 [3].

    I’ve created a demo that uses the feature [4] [5], but you’ll need to be using a browser that supports it, such as the mentioned Safari 3.

    Quote Originally Posted by RisTar View Post
    Each time that i want to do it i use tables and i'm not so sure that this is
    the proper way ...
    Using table elements exclusively for layout purposes is definitely not the proper way to be doing things. Use elements with no semantics attached (i.e., div or span elements) instead.

    References
    1. http://www.w3.org/TR/2005/WD-css3-ba...the-background
    2. http://dev.w3.org/csswg/css3-background/#the-background
    3. http://www.apple.com/safari/download/
    4. http://www.jsgp.us/demos/cf140140-mu...nd-images.html
    5. http://www.jsgp.us/demos/cf140140-mu...d-images.xhtml
    For every complex problem, there is an answer that is clear, simple, and wrong.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •