0

Is it possible to have 1 div and set multiple background for each height ?

I don't want to have New DIV , i want to set 3 backgrounds for 1 div .

for example ::

from height : 0px until height : 250px >> background1

from height : 250px until height : 550px >> background2

if it is possible , please give me an example .

thanks .

  • 1
    possible duplicate of [Can I have multiple background images using CSS?](http://stackoverflow.com/questions/423172/can-i-have-multiple-background-images-using-css) – Josh Crozier Jan 20 '14 at 05:24
  • If you are CHANGING bg images based on the dynamic height of the div you will need javascript. – Paulie_D Jan 20 '14 at 11:13

1 Answers1

1

Multiple backgrounds involved using multiple property assignments with multiple values, separated by a comma:

#BG {
    background:        url(bg1.png),
                       url(bg2.png),
                       url(bg3.png);
    background-repeat: no-repeat,
                       no-repeat,
                       repeat-y;

    background-position: 0 0,
                         30px 70px,
                         right top;

    width: 400px; 
    height: 400px;
    border: 1px solid #ccc;
}
java seeker
  • 1,246
  • 10
  • 13