You are here:    Home » KidSpace » Learning HTML

KidSpace Home

Ask a Question

Subjects

Reference
The World
Computers
Health & Nutrition
Reading Zone
Math & Science
Art & Music
Sports & Rec.
Fun Stuff

Features

Science Fair
Stately Knowledge
Learning HTML
Orca Search
Poison Prevention
Author Page
Culture Quest
Story Hour
Say Hello
U.S. Presidents

Valid XHTML 1.0 Transitional

Valid CSS!

Got a question? Ask our Ask a Question librarians!
(Use our Contact Us form for questions/suggestions about our site.)

Background Attributes

WARNING! You really shouldn't use the bgcolor="" and the background="" attributes once you understand HTML better and after you learn CSS (which we'll explain a little later). However, since you're just starting to learn HTML, go ahead and use it for now.

Now that you know how to do cool things with your text, as well as how to make links and add images and graphics, I will show you how to put some finishing touches onto your web page.

To change the background color of your webpage, you need to place a background color attribute bgcolor, and a color value, which will be one of the color codes that you learned about earlier, inside the start body tag:

<html>
<head>
<title>Learning HTML</title>
</head>
<body bgcolor="#3cb371">
</body>
</html>

To use an image or graphic as your background, you need to use the background attribute and give the filename of the image or graphic for the value:

<html>
<head>
<title>Learning HTML</title>
</head>
<body background="background.jpg">
</body>
</html>

If you decide to change the background, just make sure that your text can be read easily when displayed. right arrow

This resource originally created by Deborah Dunk.
Revised and edited by Michael Galloway in 2005 & in 2006.

Updated on 28 Nov 2006
 
School of Information University of MichiganThe iSchool at DrexelFlorida State University College of Information
 
© 1995-2008 The Regents of the University of Michigan. All rights reserved.
© 2008, Drexel University, All Rights Reserved