5 replies [Last post]
kevinrhart
Offline
Regular
Last seen: 14 years 19 weeks ago
Joined: 2006-02-26
Posts: 16
Points: 0

I'm having trouble finding out what is wrong with the validation of the following site.
http://www.hartshouse.utvinternet.com/cmanmain.html
Can anyone put me right .
K
Here are the results:
# Error Line 141 column 21: document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag.

<div id="movetoright"><img src="countrymansm.jpg" alt="The Countryman" width="20

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").


# Error Line 141 column 100: end tag for "img" omitted, but OMITTAG NO was specified.

...tryman" width="200px" height="146px">

You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

jlhaslip
Offline
Enthusiast
Last seen: 11 years 7 weeks ago
Timezone: GMT-6
Joined: 2006-02-02
Posts: 199
Points: 0

A Validation issue

Change this:

<div id="movetoright"><img src="countrymansm.jpg" alt="The Countryman" width="200px" height="146px">

to this:
<div id="movetoright"><img src="countrymansm.jpg" alt="The Countryman" width="200px" height="146px" />

and try it again. Xhtml requires closing of all tags. The Image tag closing is done by inserting the " />" at the end.

Notice there is one space in front of the '/'.

I'm having a good day...so far.

Hugo
Hugo's picture
Offline
Moderator
London
Last seen: 5 years 26 weeks ago
London
Joined: 2004-06-06
Posts: 15668
Points: 2806

A Validation issue

<p>
<div id="">
</div>
</p>

Also when you declare width/height attributes on image elements don't use a unit on them, images are PX: width="200"

Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
----------------------------------------------------------------
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me

gary.turner
gary.turner's picture
Offline
Moderator
Dallas
Last seen: 22 hours 2 min ago
Dallas
Timezone: GMT-5
Joined: 2004-06-25
Posts: 9761
Points: 3843

A Validation issue

You've put the div within a p. Not allowed.

#140 <p>
#141 <div id="movetoright"><img src="countrymansm.jpg" alt="The Countryman" width="200px" height="146px">
…
#145 … </p>

cheers,

gary

If your web page is as clever as you can make it, it's probably too clever for you to debug or maintain.

kevinrhart
Offline
Regular
Last seen: 14 years 19 weeks ago
Joined: 2006-02-26
Posts: 16
Points: 0

A Validation issue

Thanks guys. All is working as it should be. Thanks to you all.
K

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 15 weeks 5 days ago
Joined: 2004-06-30
Posts: 9668
Points: 801

A Validation issue

The validator doessort of tell you the problem.

Quote:

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").

Verschwindende wrote:
  • CSS doesn't make pies