Share this Page URL

Chapter 15. Sheet Music: Styles for Font... > Using Background Styles - Pg. 176

Sheet Music: Styles for Fonts, Colors, and Backgrounds 176 As you learned back in Chapter 6, "A Picture Is Worth a Thousand Clicks: Working with Images," you can use the <BODY> tag to set up your page with either a background color (using the BGCOLOR attribute) or a background image (using the BACKGROUND attribute). Either way, the attribute you set applies to the entire page. With style sheets, however, you can apply a background color or image to sections of your page, or even to individual words. The secret to this lies in two styles: background-color and back- ground-image. To set a background color, use either a color name or an RGB value: background-color: blue background-color: #0000FF To specify a background image, use the following syntax: {background-image: URL(filename)} Here, filename is the name of the graphics file you want to use (or an URL that points to the file). The HTML code below shows a few examples of these styles (see ssback.htm on the CD in this book). <HTML> <HEAD> <TITLE>Style Sheet Backgrounds</TITLE> </HEAD> <BODY> <DIV STYLE="background-color: black; color: white"> The background style is great for setting off entire sections of text using a different color. For example, this section