Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Daisy Adams
43 PointsCan't find whats wrong... HTML
Hi,
Im taking a web developing class and right now we're learning just the plain HTML but we have to insert a background image and I don't know why it won't show up. I've put the image and code file in the same folder. I know its easy but I still can't find it! lol Will gladly appreciate it if someone looked over it and tell me wheres the error. Thanks!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> <head> <title>My Labs</title> </head>
<body background="minimal+wallpapers+55.jpg" bgcolor="#ffff00"> <h1>HELLO</h1>
</body> </html>
4 Answers
Sue Johnson
16,648 PointsYour code is ancient and obsolete. Try HTML 5 and put the background image in using CSS. I tested your code and it works putting my own image in to replace yours, the image appears in the background. Is the name of the image file correct and is it RGB format?
Daisy Adams
43 PointsThanks for your response. Yeah it's because my professor is the teaching us HTML not HTML 5 right now we have to go way back lol. When I saved it i save it as index.htm to preview but it doesn't even pop up with the correct bg color
Sue Johnson
16,648 PointsI am getting the background color when I delete the image background, the code looks fine to me. Something else is wrong, maybe it is something to do with the file. What software did you use to create it and are you getting the word "HELLO"?
Stephanie van Doleweerd
3,075 PointsDumb question, but are you sure you saved the file and refreshed the preview window? I've done that a few times here, learning the Workspace.