Class Notes (1,100,000)
CA (630,000)
SFU (10,000)
CMPT (500)
Lecture

CMPT165_CommonValidationErrors.pdf


Department
Computing Science
Course Code
CMPT 165
Professor
Colin Stewart

Page:
of 9
Common Validation Problems
This is not a complete list of problems you might have when validating, but it covers the most
common ones. Always make sure you start your pages with the Valid HTML 4.01 Template (on the
Notes page, under Even More HTML, and also on the Homework page, under Project 1).
Missing
<DOCTYPE>
Error Message:
or
or
Meaning:
You’re missing the following:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
Solution:
Put the above lines in your HTML file, above the <html> tag:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
Missing
<head>
Error Message:
or
Meaning:
You’re missing a <head> tag in your file.
Example:
<html>
<body>
<h1>My site about bugs</h1>
</body>
</html>
Solution:
Always include a header:
<html>
<head>
<title>BUGS</title>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8">
</head>
<body>
<h1>My site about bugs</h1>
</body>
</html>
Missing
<title>
Error Message:
Meaning:
You’re missing a title in your <head>
Example:
<head>
<meta http-equiv="Content-Type"
content="text/html;charset=utf-8" >
</head>
Solution:
Always include a title:
<head>
<title>Buffalos</title>
<meta http-equiv="Content-Type"
content="text/html;charset=utf-8" >
</head>