Hello. I hope someone can help. I have an image in the background of a wordpress widget but when resizing the page the image stays the same size. Is there an easy way using CSS to make the background image scalable, similar to the CSS-Tricks homepage area used for the polls or the lodge login?
Example. I have a twitter widget that dynamically changes height depending on the length of the tweet so I would need the background image to be fluid so that it resizes to the widget box size.
Hello. I hope someone can help. I have an image in the background of a wordpress widget but when resizing the page the image stays the same size. Is there an easy way using CSS to make the background image scalable, similar to the CSS-Tricks homepage area used for the polls or the lodge login?
Example. I have a twitter widget that dynamically changes height depending on the length of the tweet so I would need the background image to be fluid so that it resizes to the widget box size.
Thanks for your time.
The code I have used for the widget background:
background-size:cover; or background-size:contain;
Perfect, thanks. This worked...
and then I added...
That could turn around to bite you by using the 100% stuff.
Is there a better way of doing it? Using your code alone didn't work so I had to add the 100% part of it.