Help - Search - Members - Calendar
Full Version: HTML for background image
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
klynnk1
I am using the validator and bringing in my template html a little at a time to make corrections.
The background image I use works fine in my inkfrog template but gets an error in the validator.


This is how I have it in my inkfrog template ...
<body background="http://imgs.inkfrog.com/pix/klynnk1/Pinups_Template_Background_TEST.jpg">

Can you tell me how it is supposed to be written?
I get the Error: element BODY not allowed here; check which elements this element may be contained within

If I remove body ...
I get the Error: there is no attribute BACKGROUND for this element (in this HTML version)

HELP - I am frying my brain .... wacko.gif

-----------------------------------------------------------------------------------------------------------

The first part of my template is below.




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>Single pinups 2/sided</title>
</head>

<body>
<table width="80%" border="0" align="center" cellspacing="0" cellpadding="0">

<body background="http://imgs.inkfrog.com/pix/klynnk1/Pinups_Template_Background_TEST.jpg">

<tr><td align="left" colspan="2"><img src="http://imgs.inkfrog.com/pix/klynnk1/Single_Pinup_TITLE_BAR.jpg"></td></tr>

<tr><td width="50%" align="center" valign="top"><img src="http://imgs.inkfrog.com/pix/klynnk1/195700316.jpg"><br>

<p style="font-family:Arial; font-size:1.2em color:#cc0033 text-align:center margin:5 5 0 5 padding:10px">
This is a single page pinup 8 x 11 inches.<br>
FREE Shipping on additional single pinups.</p>

</table>
Darin McGrew
You have two <body> tags. You can have only one.

See also http://htmlhelp.com/reference/html40/structure.html
klynnk1
<body background="http://imgs.inkfrog.com/pix/klynnk1/Pinups_Template_Background_TEST.jpg">

if I remove "body" from this .....

<background="http://imgs.inkfrog.com/pix/klynnk1/Pinups_Template_Background_TEST.jpg">

I get these two errors:

Error: an attribute specification must start with a name or name token

Error: element BACKGROUND-IMAGE not defined in this HTML version

----------------------------------------------------------------------------------------------


This is where I am trying to get my html code

http://www.w3schools.com/css/tryit.asp?fil...ackground-image
Darin McGrew
You need a single <body> tag, and that <body> tag should have the background="..." attribute.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.