Background images

Whether serving as a method to frame the page, incorporate a faded picture behind text or use patterns in a specific area, the background image is an important tool at the web designer’s disposal. 

Perhaps the best examples of the power of background images in Web publishing, the submissions to CSS Zengarden apply backgrounds to a variety of HTML tags. Nowhere in these examples are traditional IMG tags used.

Common tags that use backgrounds

Almost any tag that fills space in the browser window—i.e. not the img or br tags—can employ a background image.  But most often backgrounds are incorporated in the CSS of these XHTML tags:

For our purposes, there are four primary types of background images and we initially change the body background appearance:


The basic background image


The horizontally repeating background


The vertically repeating background


The non-repeating background image


Simple background creation

Open Photoshop.  While many backgrounds are offered on the Web to freely use, designers generally require customized backgrounds with specific colors and dimensions.

Our first background will be a simple, repeating lined image that is made by following these steps:

Start a new image


Resize the preview


Use the pencil tool


Save it

  1. Select File > Save for Web and Devices
  2. Save the file as a PNG-24 with the file name “bg.png”.
  3. Return to your CSS stylesheet or begin a new CSS document and type the following (or add to the body element if it is already defined):
  4. body {
    background-image: url(bg.png);
    }


Look at it


Make it vertical

To make the background vertical, we can either start a new small graphic or simply rotate our existing image.  For simplicity’s sake, we will do the latter.

  1. From the menu bar, select “Image > Rotate Canvas > 90° CW”
  2. This rotates the image clockwise and makes our stripe vertical.
  3. Save as “bg.png” and refresh the page.


Make a diagonal background

Besides a vertical or horizontal repeating background, it is possible to make a diagonal image with the same tools.diagonal

  1. Start a new canvas with equal width and height.
  2. Using the pencil tool, click a diagonal pattern of square pixels. Hold shift to ensure it is a 45 degree angle.
  3. Save for Web and Devices over the existing “bg.png”.
  4. Refresh the page.

 

jour 355

weekly schedule

  1. Internet & Web / HTML
    Readings: Get books
  2. Bits & bytes / HTML / Embedding / Code
    Readings: Briggs ch. 1
  3. Images / Exercise 2
    Readings: Briggs ch. 2
  4. Exam 1 / CSS Intro / Colors
    Readings: Briggs ch. 3
  5. Divisions / Web typography / Photoshop text
    Readings: Briggs ch. 4
  6. CSS ID / Project one guide
    Readings: Briggs ch. 5
  7. Exam 2 / Uploading / Backgrounds
    Readings: Briggs ch. 6
  8. Project one due / Evaluation guide
    Readings: Briggs ch. 7
  9. Spring Break
  10. Search / Project eval / Online advertising
    Readings: Briggs ch. 8
  11. Standards / Audio / Backgrounds
    Readings: Briggs ch. 9
  12. Exam 3
    Readings: Briggs ch. 10
  13. CSS3 / Usability / Lightbox
    Readings: Briggs ch. 11
  14. Project editing
    Readings: TBD
  15. Material review / Exam 4
  16. Final project
  17. Final project due

Matthew Blake    Department of Journalism    CSU-Chico   
mdblake@csuchico.edu    (530) 898-3608