Adding a Background Image to Your HTML Output

The previous example showed how to add a logo at the top of each output page. This example shows how to use an image for the background. We will define a style template with a repeated image of the company logo as a background. Again, we will be working with the Body style element. This time, instead of the PREHTML= attribute, we will take advantage of another attribute, BACKGROUNDIMAGE=. This attribute enables you to specify an image file to use as the page background. You do not have to write the HTML code yourself if all you want is a background image. The following code defines the new style template CorpLogoBG.

PROC TEMPLATE; DEFINE STYLE CorpLogoBG; PARENT=Styles.Default; CLASS Body / backgroundimage="corporatelogobg.gif"; ...

Get Output Delivery System: The Basics and Beyond now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.