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 3 of 3
  1. #1
    New Coder
    Join Date
    Sep 2007
    Posts
    27
    Thanks
    7
    Thanked 0 Times in 0 Posts

    can you set css background twice

    is it possibl to set a css background then set a transparent backgournd over the top with the odd image in it but making this all under the rest of my site not sure if iv made this clear ror not .

  • #2
    Senior Coder
    Join Date
    Nov 2003
    Location
    Minneapolis, MN
    Posts
    2,879
    Thanks
    2
    Thanked 65 Times in 56 Posts
    You can only have one background image per element using CSS, but you can nest elements to fake it:

    Code:
    <body>
       <div id="wrapper">
          <!-- content -->
       </div>
    </body>
    
    body {
       background: url(image1.jpg) left top no-repeat
    }
    
    #wrapper {
       background: url(image2.jpg) left bottom repeat-x;
    }

  • #3
    Regular Coder
    Join Date
    Sep 2007
    Location
    Raleigh, NC
    Posts
    273
    Thanks
    7
    Thanked 59 Times in 52 Posts
    As of the CSS3 spec you can, but Safari is the only browser with any support for that at current, and it'll probably be a long time before we see the IEs catch up, so the above method is what you want to use.


  •  

    Posting Permissions

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