validation

F

fulio pen

I usually didn't validate any page, as it displayed just fine without
the validation. Recently I tried to do it on some pages. But some
instructions seemed confusing For instance, once I had following
division:


<div id='source'>
<span><u>Source</u>: </span> <br />
Language: Textbook One. 2nd edition: June 1984. 7th Printing June
1988. Shanghai: Education Press.
</div>

After validating, I got following three messages, but still didn't see
anything with the division:

Validation Output: 3 Errors

Line 47, Column 1: Saw < when expecting an attribute name. Probable
cause: Missing > immediately before.
<div id='source'>
✉
Line 47, Column 17: End tag had attributes.
<div id='source'>
✉
Line 47, Column 17: Stray end tag div..
<div id='source'>

Can anyone tell what the 3 messages really mean? And what to do to
correct the errors? Thanks.

fullio pen
 
J

Jukka K. Korpela

<div id='source'>
<span><u>Source</u>:</span> <br />
Language: Textbook One. 2nd edition: June 1984. 7th Printing June
1988. Shanghai: Education Press.
</div>

After validating, I got following three messages, but still didn't see
anything with the division:

That's because the problem is earlier in the document. This is one
reason why you should post a URL, not (just) code snippets.
Line 47, Column 1: Saw < when expecting an attribute name. Probable
cause: Missing> immediately before.

So there's something missing _before_ the div element.
Line 47, Column 17: End tag had attributes.

So apparently there is something like </div (an end tag without the
closing ">") before the div. The error messages are somewhat confusing
because the error makes the validator parse your tag <div id='source'>
as if it were part of the preceding end tag.

P.S. Independently of this, consider using something else instead of
<u>. It should only be used in situations where you really mean
typographical underline, and underlining anything but a link is risky on
the web, because underlining is so often understood as meaning a link.
Using <strong> might be better, or maybe <em>; maybe no markup and no
styling is really needed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,585
Members
45,082
Latest member
KetonaraKetoACV

Latest Threads

Top