That may be because you are missing the main tag <html>
.
Do this:
<!DOCTYPE html>
<html>
<head>
<title>A Hello World Page</title>
</head>
<body>
<p>Hello World</p>
</body>
</html>
<html>
is the main tag, browser will look for to tell whether it is html or not.
Also make sure it is saved as .html
or .htm