html vaildation

S

saz

RE_MOVE_THIS_terryb@ said:
I'm a little confused! I validate my html code at the following two
sites and I get two different answers with respect to the font tag.
w3.org tells me to Not use the # symbol and rankquest.com tells me I
should. Which is right? I would lean toward w3.org being correct.

<font color="C16162">
<font color="#C16162">

http://www.rankquest.com/tools/Html-Validator.php

http://validator.w3.org/

Thanks,
Terry
It would help to give the URL.
 
T

terry

saz said:
It would help to give the URL.

Sorry! I was hoping someone could answer the question about the # in
the tag without my giving the URL ... because ... although I think we
have a very classy site it "might" offend someone to see a girl in
lingerie. That's what we sell.

Ok, that's the disclaimer.
http://www.4everhers.com

Terry
 
E

Els

terry said:
Sorry! I was hoping someone could answer the question about the # in
the tag without my giving the URL ... because ... although I think we
have a very classy site it "might" offend someone to see a girl in
lingerie. That's what we sell.

Ok, that's the disclaimer.
http://www.4everhers.com

I see the validator at w3.org say the following:
Line 480 column 182: an attribute value must be a literal unless it
contains only name characters.

....ccount at 4everhers.com"><font color=#006600>My
Account</font></a></div></td>

The error is not the #, but the lack of " and " on either side of the
color value. The right syntax is color="#006600", not color=#006600.
 
B

Benjamin Niemann

terry said:
I'm a little confused! I validate my html code at the following two
sites and I get two different answers with respect to the font tag.
w3.org tells me to Not use the # symbol and rankquest.com tells me I
should. Which is right? I would lean toward w3.org being correct.

<font color="C16162">
<font color="#C16162">

http://www.rankquest.com/tools/Html-Validator.php

http://validator.w3.org/

mmm... judging from the reports (w3c: 85 errors, rankquest: 265 warnings),
the color attribute seems to be just a minor problem. And at #118 rankquest
goes completely crazy...

If Els is right and you did not quote the color value, then follow his
advise. But on the other hand the validator says nothing about removing the
#, but it says clearly that the value must be quoted - so you might be
talking about something else.

From the brief look at rankquest (which I did not know before), it performs
more checks than just pure validation. Unfortunately the report seem to be
rather buggy.

The validator does *not* look at (CDATA) attribute values. It does not know
that colors should be in the form '#RRGGBB' or that href should be an URI.
This is out of the scope of a pure validator.

Rankquest seems to check many attribute values for correctness, but I'm not
sure if and how well it's on the validation part.
 
T

Toby Inkster

terry said:
I'm a little confused! I validate my html code at the following two
sites and I get two different answers with respect to the font tag.
w3.org tells me to Not use the # symbol and rankquest.com tells me I
should. Which is right? I would lean toward w3.org being correct.

<font color="C16162">
<font color="#C16162">

I would imagine that you're misinterpreting W3.org's error message. With
the hash sign is correct.

That said, the <FONT> element is terribly outdated. Use CSS instead.
 
T

terry

Benjamin said:
mmm... judging from the reports (w3c: 85 errors, rankquest: 265 warnings),
the color attribute seems to be just a minor problem. And at #118 rankquest
goes completely crazy...

If Els is right and you did not quote the color value, then follow his
advise. But on the other hand the validator says nothing about removing the
#, but it says clearly that the value must be quoted - so you might be
talking about something else.

From the brief look at rankquest (which I did not know before), it performs
more checks than just pure validation. Unfortunately the report seem to be
rather buggy.

The validator does *not* look at (CDATA) attribute values. It does not know
that colors should be in the form '#RRGGBB' or that href should be an URI.
This is out of the scope of a pure validator.

Rankquest seems to check many attribute values for correctness, but I'm not
sure if and how well it's on the validation part.

Thanks to all! I did misinterpret the error message. The font tag has
been fixed by adding "" around the color. I'm down to 24 errors ...
mostly MARGIN errors which I will figure out.

I do have one more error that I could use help with. The DOC TYPE ... I
don't know what I have or even how to find out. I know that sounds
idiotic but what can I say. I've read stuff on w3.org and other sites
but I've never run across a way to determine what I have. Maybe I'll
try the "trial and error" method.

Thanks,
Terry
 
D

David Dorward

terry said:
I do have one more error that I could use help with. The DOC TYPE ... I
don't know what I have or even how to find out. I know that sounds
idiotic but what can I say. I've read stuff on w3.org and other sites
but I've never run across a way to determine what I have. Maybe I'll
try the "trial and error" method.

Generally you should pick a markup language and write your code to that, and
your choice of markup language will determine the Doctype. Writing tag soup
then trying to guess what Doctype best fits it is pretty much doomed to
failure.

This side of the millennium, browser support for stylesheets is good enough
to switch to HTML 4.01 Strict[1]. We haven't yet reached the stage where
using any form of XHTML is useful for the (vast) majority of authors.

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


[1] With a few rare exceptions ... well ... one exception. The start
attribute for ordered lists, but that doesn't get used often.
 
M

Mark Parnell

Deciding to do something for the good of humanity, terry
I'm a little confused! I validate my html code at the following two
sites and I get two different answers with respect to the font tag.

Use CSS instead and it won't be an issue. :)
 
S

Stan McCann

I do have one more error that I could use help with. The DOC TYPE
... I don't know what I have or even how to find out. I know that
sounds idiotic but what can I say. I've read stuff on w3.org and
other sites but I've never run across a way to determine what I
have. Maybe I'll try the "trial and error" method.

Use the following doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

This http://www.alistapart.com/stories/doctype/ may help you understand
why.

I'll warn you, you'll get more errors though. You won't be able to use
<font> as it is deprecated. Instead, set a style for the element(s)
you want affected.
 
B

Big Bill

mmm... judging from the reports (w3c: 85 errors, rankquest: 265 warnings),
the color attribute seems to be just a minor problem. And at #118 rankquest
goes completely crazy...

If Els is right and you did not quote the color value, then follow his
advise.

*His* advice?

BB
 
D

dorayme

David Dorward said:
terry said:
I do have one more error that I could use help with. The DOC TYPE ... I
don't know what I have or even how to find out. I know that sounds
idiotic but what can I say. I've read stuff on w3.org and other sites
but I've never run across a way to determine what I have. Maybe I'll
try the "trial and error" method.

Generally you should pick a markup language and write your code to that, and
your choice of markup language will determine the Doctype. Writing tag soup
then trying to guess what Doctype best fits it is pretty much doomed to
failure.

This side of the millennium, browser support for stylesheets is good enough
to switch to HTML 4.01 Strict[1]. We haven't yet reached the stage where
using any form of XHTML is useful for the (vast) majority of authors.

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

Yes, to best learn and do things right. But I would say, looking
at your site, just for now, use the transitional one you have for
practical purposes on line (it is more forgiving and will not
worry you so much - esp. if you have this site out there making
money). Work off line on a strict dtd. Till you are happy...
 
B

Blinky the Shark

Els said:
Not *everyone* knows that Els is short for Elizabeth ;-)

I did not know that. I thought Els was just some kind of Dutch name in
it's own right. :)
 
E

Els

Blinky said:
I did not know that. I thought Els was just some kind of Dutch name in
it's own right. :)

So, you're admitting to never having read the 'about' page on my site
then! Bad boy! ;-)

It's a name in its own right in the same way Liz and Beth are :)
 
B

Blinky the Shark

Els said:
So, you're admitting to never having read the 'about' page on my site
then! Bad boy! ;-)

I'm pretty sure I did, Els. Apparently I didn't remember that, then.
 
B

Benjamin Niemann

Els said:
Not *everyone* knows that Els is short for Elizabeth ;-)

Forgiveness for my ignorance...

I remember the case with a person called 'Andrea' who I believed was female
until I realized the he was just from Italy :)
 
B

Benjamin Niemann

David said:
terry said:
I do have one more error that I could use help with. The DOC TYPE ... I
don't know what I have or even how to find out. I know that sounds
idiotic but what can I say. I've read stuff on w3.org and other sites
but I've never run across a way to determine what I have. Maybe I'll
try the "trial and error" method.

Generally you should pick a markup language and write your code to that,
and your choice of markup language will determine the Doctype. Writing tag
soup then trying to guess what Doctype best fits it is pretty much doomed
to failure.

This side of the millennium, browser support for stylesheets is good
enough to switch to HTML 4.01 Strict[1]. We haven't yet reached the stage
where using any form of XHTML is useful for the (vast) majority of
authors.

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


[1] With a few rare exceptions ... well ... one exception. The start
attribute for ordered lists, but that doesn't get used often.

But beware: Because the validator did not find a document type declaration,
it implied HTML 4.01 *transitional*. If you know use the strict doctype
(which is, eh.. stricter :) ), the validator gives you ~50 new errors...
If you want to stick with transitional for now (and convert to the prefered
strict later), use

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

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

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,679
Members
48,796
Latest member
Greg L.

Latest Threads

Top