barsan_petru — 2007-01-29T04:20:14-05:00 — #1
I get this error from the validator :
Line 26 column 112: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified.
..."><tr><td valign="top"><table border=0 width=100% cellspacing=0 cellpadding=0...
I know i should have something like this " border='0' ", but i would prefer to leave the numeric values as is. How can this be done ? Is there a way to specify SHORTTAG YES somewhere in the document, and after that not to deal with this issue ?
Many thanks in advance.
zcorpan — 2007-01-29T04:40:02-05:00 — #2
Use this doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
kravvitz — 2007-01-29T04:42:26-05:00 — #3
It's a badly written error message.
You have two choices: either switch to HTML 4.01 (there's nothing wrong in doing that) or make your code be valid X(HT)ML. (Technically there's a third choice, but doing so is very bad for the health of the web. If you choose to use XHTML, you must write valid code.)
Edit: Simon, why do you recommend a doctype that doesn't include a URL?
autisticcuckoo — 2007-01-29T05:25:54-05:00 — #4
SHORTTAG YES is declared in the SGML declaration for HTML (but not for XML). It is not something you can change.
In XHTML, all attribute values must be quoted.
In HTML, you may omit the quotation marks provided that your attribute value contains only letters (A-Z), digits, hypens, underscords, colons and periods.
width attribute has the value
100%, it must be quoted even in HTML.
barsan_petru — 2007-01-29T06:05:25-05:00 — #5
thanks for the replies. I changed the DOCTYPE to html 4.01. I have to make valid html for a huge site with hundreds of files, and lots of errors(often the values ar not quoted). Are there any programs that are meant to do this automatically from php sources?
zcorpan — 2007-01-29T10:46:01-05:00 — #6
Because it's shorter and does the same thing.
kravvitz — 2007-01-29T18:15:01-05:00 — #7
It doesn't trigger standards mode in IE5/Mac though.
By the way, have you read "Designing with Web Standards"? It seems that Zeldman is wrong about some of the things he said regarding DOCTYPEs.
zcorpan — 2007-01-29T18:45:06-05:00 — #8
You're right. That's a bug in IE5/Mac. Who cares?
I've read the ALA article he wrote, which isn't very accurate. What did he say about them in the book?[/ot]
dan_schulz — 2007-01-29T19:43:17-05:00 — #9
Tell that to IE 6 when it whines about the lack of a link and starts throwing a temper tantrum (quirks mode).
zcorpan — 2007-01-29T19:55:44-05:00 — #10
Yeah. Doctypes don't have links for starters.
kravvitz — 2007-01-30T00:53:00-05:00 — #11
Dan probably meant a URL.
Unfortunately, I still do some projects where I am asked support IE5/Mac, so I have to care.
This is from the second edition, page 279.
He also pushes XHTML a lot and makes HTML sound outdated. He barely mentions the whole mime-type issue.[/ot]
dan_schulz — 2007-01-30T12:21:07-05:00 — #12
Yup. I was using "plain conversational language" for once .
zcorpan — 2007-01-30T12:53:32-05:00 — #13
But lack of a "link" doesn't put IE6 into quirks mode, unless you use a known legacy public identifier, such as e.g. HTML 4.01 Transitional. The doctype in #2 does indeed trigger standards mode in IE6.