Menu
Index

Create a flexible box from an image with gradients

Suppose we have the image below that we want to use it as background for text elements which are varying in size. The largest size of the text element is around 600x500. So the image below has the size of 600x500. We are going to use it to create a flexible box so that it can be used for text elements which are smaller than 600x500. Please note that for this approach to work, the image must have a background color that match the background color of the page. For example, the background color of the image below is white.