dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: How to get multiple backgrounds in the one div?

  1. #1
    Join Date
    Jun 2010
    Posts
    23

    How to get multiple backgrounds in the one div?

    Hey folks.

    I've always been curious how you get multiple backgrounds for the one div, for instance one for left and right side, one for the top, a gradient for the middle, then another on the bottom.

    If you have issues understanding this I've found a website which demonstrates the multiple backgrounds, http://www.captainrichsmith.com/

    Is there any way to do it? Or will I have to create seperate divs and set the background image for each of them?

  2. #2
    Join Date
    Dec 2005
    Posts
    2,984
    There is no way to put multiple background images on the same element in CSS2. In CSS3 it's done like the following:

    http://www.w3.org/TR/css3-background/#layering

    Although that won't help you right now.

  3. #3
    Join Date
    Jun 2010
    Posts
    23
    Cheers mate,

    so how did they do it with css2?

  4. #4
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Or will I have to create seperate divs and set the background image for each of them
    Yes. How it's done is different for each layout.
    Don't forget <body> and <html> can have background images.

  5. #5
    Join Date
    Jun 2010
    Posts
    23
    Cheers bud!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles