The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> HELP PLEASE XHTML
dmking05
post Jun 30 2011, 12:37 AM
Post #1





Group: Members
Posts: 2
Joined: 4-June 11
Member No.: 14,686



THis is my code:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--
New Perspectives on HTML and XHTML 5th Edition
Tutorial 9
Case Problem 2

The Gargoyle Collection
Author: Chris Klein
Date: June 28, 2011

Filename: gargoyle.htm
Supporting files: cassini.jpg, gbar.jpg, glogo.jpg, maa.jpg, oneil.jpg
-->

<title>The Gargoyle Collection Home Page</title>
</head>

<style type="text/css">

body
{
background-image:
url('gbar.jpg')
}

</style>


<body>
<table width="610px" cellpadding="0" cellspacing="0">
<tr>
<td valign="top">
<img src="maa.jpg" width="144" height="25" alt="Middle Age Arts" />
<h4><span style="color: yellow">Middle Age Arts</span></h4>
<a href="#">Home Page</a><br />
<a href="#">View the catalog</a><br />
<a href="#">Place an order</a><br />
<h4><span style="color: yellow">About Gargoyles</span></h4>
<a href="#">Gargoyle Products</a><br />
<h4><span style="color: yellow">Other Collections</span></h4>
<a href="#">The Vatican Collection</a><br />
<a href="#">The Rodin Collection</a><br />
<a href="#">Renaissance Masters</a><br />
</td>
<td width="445px" valign="top">
<table width="445px" cellspacing="0" cellpadding="0">
<tr>
<td colspan="3" valign="top" style = "float: center">
<img src="glogo.jpg" alt="The Gargoyle Collection" width="440" height="220" />
</td>
</tr>
<tr>
<td rowspan="2" width="220px" valign="top">
<h4 style ="float: center"><span style="color: red">From the President</span></h4>
<img src="oneil.jpg" alt="" style = "float: right" width="86" height="111" />
<p>This month Middle Age Arts introduces the Gargoyle
Collection. I'm really excited about this new set of classical
figures.</p>
<p>The collection contains faithful reproductions of gargoyles
from some of the famous cathedrals of Europe, including Notre
Dame, Rheims, and Warwick Castle. All reproductions are done to
exacting and loving detail.</p>
<p>The collection also contains original works by noted artists
such as Susan Bedford and Antonio Salvari. Our expert artisans
have produced some wonderful and whimsical works, perfectly
suited for home or garden use.</p>
<p>Don't delay, order your gargoyle today.</p>
<i>Irene O'Neil</i><br />
<b>President</b>
</td>
<td rowspan="2" width="5px">&nbsp;</td>
<td width="220px" style="float: top" bgcolor="yellow">
<h4 style = "float: center" >What can you do with a gargoyle?</h4>
Don't think you need a gargoyle? Think again. Gargoyles are
useful as:
<ul>
<li>Bird baths</li>
<li>Bookends</li>
<li>Paperweights</li>
<li>Pen holders</li>
<li>Wind chimes</li>
</ul>
Go to our catalog for more ideas!
</td>
</tr>
<tr>
<td width="220px" valign="top">
<h4 style ="float: center" /><span style="color: red">Profile of the Artist</span></h4>
<img src="cassini.jpg" alt="" style = "float: right" width="64" height="74" />
<p>This month's artist is Michael Cassini. Michael has been a
professional sculptor for ten years. He has won numerous awards,
including the prestigious <i>Reichsman Cup</i> and an Award of
Merit at the 2007 Tuscany Arts Competition.</p>
<p>Michael specializes in recreations of gargoyles from European
cathedrals. You'll usually find Michael staring intently at the
church walls in northern France. His work is represented by the
<i>Turin Gargoyle</i>, a great addition to our Gargoyle
Collection.</p>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

This is what the validator said:

Line 24, Column 23: document type does not allow element "style" here
<style type="text/css">

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).

One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).

Line 51, Column 11: there is no attribute "width"
<td width="445px" valign="top">

You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

Line 78, Column 46: there is no attribute "bgcolor"
<td width="220px" style="float: top" bgcolor="yellow">

You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

Line 94, Column 87: end tag for element "h4" which is not open
e ="float: center" /><span style="color: red">Profile of the Artist</span></h4>

The Validator found an end tag for the above element, but that element is not currently open. This is often caused by a leftover end tag from an element that was removed during editing, or by an implicitly closed element (if you have an error related to an element being used where it is not allowed, this is almost certainly the case). In the latter case this error will disappear as soon as you fix the original problem.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Jun 30 2011, 01:15 AM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 19,780
Joined: 9-August 06
Member No.: 6



What validator did you use? It doesn't sound like one of the usual ones, or maybe it is the w3c validator after all.
CODE


Line 24, Column 23: document type does not allow element "style" here
<style type="text/css">

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).


STYLE goes in HEAD and nowhere else. See the lines called Contents and Contained in here: http://htmlhelp.com/reference/html40/head/style.html . You can look that up for any element.


QUOTE
Line 51, Column 11: there is no attribute "width"
<td width="445px" valign="top">


What the validator says. You can't use 'width' for TD with a Strict doctype and should use CSS instead. Push the button that says "Hide non-strict attributes" on the TD page in the reference, http://htmlhelp.com/reference/html40/tables/td.html .

QUOTE

Line 78, Column 46: there is no attribute "bgcolor"
<td width="220px" style="float: top" bgcolor="yellow">


Same as above.


QUOTE
Line 94, Column 87: end tag for element "h4" which is not open
…e ="float: center" /><span style="color: red">Profile of the Artist</span></h4>


You have used a closing slash in the start tag. You should only use that for empty elements, i.e. elements that have no closing tag and no content, like IMG and BR. Alternativelely don't use XHTML and avoid the hacks.
CODE
<h4 style ="float: center" /><span style="color: red">Profile of the Artist</span></h4>
                           ^


Also, the value of float can't be center. Only left or right.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 3rd August 2021 - 04:44 AM