<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
”>
<html>
<head>
<title>The Labyrinth</title>
</head>
<body>
<a name= “top”><h1>The Labyrinth: Old Books/New Readers</h1></a>
<blockquote>
“Reading is so fun”<br />
- Tom Wolfe, <cite>Books in NYC</cite>
</blockquote>
<p>The Labyrinth<br />
151 Varick St.<br />
Manhattan, NY 10013<br />
(212) 555-1234
</p>
<a name= “contents”><h2>Contents</h2></a>
<ul>
<li><a href= “#about”>About The Labyrinth</a></li>
<li><a href= “#recent”>Recent Titles</a></li>
<li><a href= “#upcoming”>Upcoming Events</a></li>
</ul>
<hr />
<a name= “about”><h2>About The Labyrinth</h2></a>
<p>The Labyrinth is not the typical bookstore offering customers a maze with fantastic reads all the way through.
The Labyrinth offers:</p>
<ul>
<li>Dungeon walls and maze for the adventurous</li>
<li>Courteous and helpful staff</li>
<li>New releases and updated New York Times Best Seller section</li>
</ul>
<p>Our hours are <strong>10am to 12pm</strong> weekdays,<strong>noon to 10</strong> on weekends.</p>
<p><a href= “#contents”>Back To Contents</a> | <a href= “#top”>Back to Top</a></p>
<hr />
<a name= “\recent”><h2>Recent Titles (as of 17-Nov-2007)</h2></a>
<ul>
<li>Ian Ayers, <a href= “supercrunchers.html”>
<cite>Supercrunchers</cite></a></li>
<li>John Perkins, <a href= “confessionsofaneconomichitman.html”>
<cite>Confessions of an Economic Hitman</cite></a></li>
</ul>
<p><a href= “#contents”>Back to Contents</a> | <a href= “#top”>Back to Top</a></p>
<hr />
<a name= “upcoming”><h2>Upcoming Events</h2></a>
<ul>
<li><b>Coffee and Liquer</b>Show up between 5pm and 7pm on Wednesday and receive complimentary coffees and drinks(adults only).</li>
<li><b>Monday Madness</b>Monday Sale; buy any two books receive the third one for free.</li>
</ul>
<p><a href= “#contents”>Back to Contents</a> | <a href= “#top”>Back to Top</a></p>
<hr />
<address>
Last Updated: 17-Nov-2007<br />
Webmaster: Michael Westfield <br />
&#169; copyright 2007 the Labyrinth<br yffyy/>
</address>
</body>
</html>

Dani AI

Generated

Short version: was right — the page fails validation because of a few small, common issues rather than a mysterious parser bug. The usual culprits here are “smart” (curly) quotes introduced by a word processor or editor, a couple of small typos (an unexpected backslash in an anchor name and stray characters in a break tag), and incorrect element nesting around the heading/anchor. Fix those and the validator will stop complaining.

Practical steps to fix it:

  • Edit the file in a plain-text editor (VS Code, Notepad++, Sublime). Turn off smart quotes or run a replace for the curly quotes and replace them with plain ASCII double quotes (").
  • Make the DOCTYPE the very first line of the file and include a charset declaration near the top of the head. Save the file as UTF-8 (no BOM) so the bytes match the declared encoding.
  • Remove stray characters (the backslash before the anchor name and that odd text after a break), and place anchors as IDs on headings instead of wrapping a block-level heading with an anchor.
    A minimal modern start looks like this:
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>The Labyrinth</title>
</head>

After those fixes, validate again and iterate. For reference on the DOCTYPE and charset placement, see the MDN guidance on DOCTYPE () and the meta charset (MDN: meta charset). Also consider small semantic cleanups (add lang on <html>, use a footer for contact/copyright info, avoid <br> for layout) once the structural errors are removed.

Recommended Answers

All 4 Replies

Fails validator

http://validator.w3.org/


Not the be all and end all, but since you are asking, yes it has errors technically speaking.

Fails validator

http://validator.w3.org/


Not the be all and end all, but since you are asking, yes it has errors technically speaking.

Line 1, character 23:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//E ...
^
Error: illegal character number 147

Line 1, character 24:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//E ...
^
Error: name character invalid: only minimum literal and parameter separators are allowed

Line 1, character 24:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//E ...
^
Error: cannot continue because of previous errors

i don't understand what is wrong!

This should be valid

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>The Labyrinth</title>
</head>
<body>
<h1><a name="top">The Labyrinth: Old Books/New Readers</a></h1>
<blockquote>&quot;Reading is so fun&quot;<br>
- Tom Wolfe, <cite>Books in NYC</cite></blockquote>
<p>The Labyrinth<br>

151 Varick St.<br>
Manhattan, NY 10013<br>
(212) 555-1234</p>
<h2><a name="contents">Contents</a></h2>
<ul>
<li><a href="#about">About The Labyrinth</a></li>
<li><a href="#recent">Recent Titles</a></li>
<li><a href="#upcoming">Upcoming Events</a></li>
</ul>

<hr>

<h2><a name="about">About The Labyrinth</a></h2>
<p>The Labyrinth is not the typical bookstore offering customers a
maze with fantastic reads all the way through. The Labyrinth
offers:</p>
<ul>
<li>Dungeon walls and maze for the adventurous</li>
<li>Courteous and helpful staff</li>
<li>New releases and updated New York Times Best Seller
section</li>
</ul>
<p>Our hours are <strong>10am to 12pm</strong>

weekdays,<strong>noon to 10</strong> on weekends.</p>

<p><a href="#contents">Back To Contents</a> |
<a href="#top">Back to Top</a></p>
<hr>
<h2><a name="recent">Recent Titles (as of 17-Nov-2007)</a></h2>
<ul>
<li>Ian Ayers, <a href=
"supercrunchers.html"><cite>Supercrunchers</cite></a></li>

<li>John Perkins, <a href=
"confessionsofaneconomichitman.html"><cite>Confessions
of an Economic Hitman</cite></a></li>
</ul>
<p><a href="#contents">Back to Contents</a> |

<a href="#top">Back to Top</a></p>
<hr>
<h2><a name="upcoming">Upcoming Events</a></h2>
<ul>
<li><b>Coffee and Liquer</b>Show up between 5pm and 7pm on
Wednesday and receive complimentary coffees and drinks(adults
only).</li>
<li><b>Monday Madness</b>Monday Sale; buy any two books receive the
third one for free.</li>

</ul>
<p><a href="#contents">Back to Contents</a> |
<a href="#top">Back to Top</a></p>

<hr>
<address>Last Updated: 17-Nov-2007<br>
Webmaster: Michael Westfield michael@thelabyrinth.com<br>
© copyright 2007 the Labyrinth<br>
</address>
</body>
</html>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.