Moreover, at some point in the future it could happen that your code is not
recognized anymore, or produces an outcome different from what you
intended.
[On the other hand, browsers will - in general - understand correct code
from a previous version.]
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN">
and then submit it to a validation site.
Here are the details.
One way is to do it before the HTML code. The next line takes care of the common choice of characters, ISO 8859-1, (Latin-1):
<?xml version="1.0" encoding="iso-8859-1"?>
Alternatively, add in the <head>...</head>
part of
the HTML code the line (note the use of quotation marks - it is not a typo)
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
Here are a few examples (from http://www.htmlhelp.com/tools/validator/doctype.html).
The information about the URL against which to check the file need not be
provided.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN">
or
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
"http://www.w3.org/TR/REC-html40/strict.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2
Final//ENC">
The World Wide Web
Consortium's validation site is http://validator.w3.org/.
This site offers validation of Cascading Style Sheets (CSS) as well.
To see what it does (and why), look at http://validator.w3.org/docs/help.html.