jp19 25

Hello and greetings for the new year! I am working on a quotes site on new year, where I have set background image for a div on which a scrolling quote is displayed using some javascript code. I tried background-size: 100% / cover / contain ... but none of them achieve what I want and I am looking for some new solution. What I am saying is is that if div is large, then background image should scale down and be shown fully. Thanks.

  • I'm not sure I understand what you're going for? Are you looking for it to be the size of the element, unless the element is larger, in which case it should be the image size? Ktash almost 6 years ago

2 answers

danwellman 5600
1
point
This was chosen as the best answer

Is this what you need?

Answered almost 6 years ago by danwellman
1
point

This one I like as it's nice and easy. Here it is.

Answered almost 6 years ago by sbl2000
  • I guess this too uses javascript.. and the page hung for few seconds when I loaded. So I guess its heavyweight script. jp19 about 5 years ago