When using CSS-Doodle to create the background, one can use the CSS overlay trick (see for example How TO - Overlay). However, to create the CSS-Doodle background in the size of the text content. One can use CSS together with JS.
Here is an example.
The above code will be rendered as follow.
Note that it’s better to calculate the height of the header div by adding up the height of blocks, for example, using $(".header h1").outerHeight(true)
instead of simply $(".header").outerHeight(true)
.