Forum Moderators: open

Message Too Old, No Replies

Multiple backgrounds with CSS

         

jfred1979

4:15 am on Aug 9, 2003 (gmt 0)

10+ Year Member



How can I set up multiple backgrounds for one div in CSS (ie: a different image in each corner)? I've tried just using multiple instances of 'background' but it only displays the last one defined.

tedster

4:40 am on Aug 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



it only displays the last one defined

That's the way it works. You would need to make one big image, or else create nested divs, or use a table with four <td>s -- something to give you four separate elements that can each have a different background-image.

rahmuss

1:20 am on Aug 12, 2003 (gmt 0)

10+ Year Member



Tedster is right. You would have to define a seperate class for 4 "div"s in order for that to work.

BjarneDM

11:04 am on Aug 19, 2003 (gmt 0)

10+ Year Member



It's simple to do it:

<div id="contents">
<img src="" style="postion:absolute; top:0px; left:0px;">
<img src="" style="postion:absolute; top:0px; right:0px;">
<img src="" style="postion:absolute; bottom:0px; left:0px;">
<img src="" style="postion:absolute; bottom:0px; right:0px;">

<p id="myText">
blah - blah
</p>

</div