Validation error DOCTYPE HTML - html

I'm trying to validate my own code right now. I got the error
"no document type declaration; implying "< !DOCTYPE HTML SYSTEM>""
When i put < DOCTYPE> at the beginning of my code, i get errors for the "&nbsp" i used in my code. i used "&nbsp" to align my numbers.
Is there another code for just SPACE?
this is the outline of my code is:
<html>
<head>
<title>...... </title>
</head>
<body>............</body>
</html>

Is there another code for just SPACE?
Yes. Try   instead of
<!DOCTYPE html>
<html>
<head>
<title>
</title>
<body>
<div>Just testing  space</div>
</body>
</html>
jsfiddle example

ensure you have a ; at the end of &nbsp so it's

You can do something like this:
<!DOCTYPE html>
<html>
<head>
<title>
</title>
<body>
</body>
and you can learn more about DOCTYPE here

Related

Why does my html file not show up in Chrome?

So I started learning HTML today and the first file I coded does not come up in Chrome after being formatted. This is what the code looks like:
<!DOCTYPE html>
<html>
<head>
<title>Nikolay's Website</title>
</head>
<body>
</body>
</html>
And after I tried opening the file, which is of type "Chrome HTML Document" btw (thought it might help as info), it shows a blank page with no heading. Even if I remove the code and type "Hello World" it would still show a blank page in my browser.
HTML page should have the following default structure. Please refer this link https://www.w3schools.com/html/default.asp
<!DOCTYPE html>
<html>
<head>
<title>Nikolay's Website</title>
</head>
<body>
Hello World
</body>
</html>

href vs html tag when pointing to url

I'm just learning HTML and trying to figure out whether the tag after the doctype line in the code below should be html or href. I know that href should be used when referring to url's but also that because there is a closing bracket for </html>, therefore there should also be an opening <html>. Thanks.
<!DOCTYPE html>
< **html/href** xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>The Title</title>
</head>
<body>
.
.
</body>
</html>
Use it as shown below -
<html>
<head>
<title>MyWorl</title>
</head>
<body>
<a href="http://www.w3.org/1999/xhtml" >XHTML</a>
</body>
</html>

Html header element appears in body when using <DOCTYPE html>

I'm a beginner in web programming and I found out that when I have my header.php without the <DOCTYPE html> declaration in the beginning the html structure looks right as you can see here in a short example.
But when I modify the header.php and use the <DOCTYPE html>, the html structure changes to:
<html>
<head></head> <!-- empty head -->
<body>
<doctype html>
<title>Title</title>
"
context
"
</doctype>
</body>
</html>
Why is that?
Edit: This question is just the result of a basic typo mistake.
Apologies I didn't read through that properly and just adjusted the initial doctype.
Correction:
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
</head>
<body>
</body>
</html>

Stray start tag Error

I have the following code
<!DOCTYPE html>
<html>
<head>
<title>site title</title>
</head>
<body>
</body>
</html>
firefox inform that "stray start tag <html>" , "stray start tag <head>" , "stray end tag <head>" and "An body start tag seen but an element of the same type was already open"
how can I solve this?
please help
When I open the page in Chrome, I get this output:

There is something strange going on in your supplied code, like unprintable characters. When I type it manually, there is no problem:
<!DOCTYPE HTML>
<html>
<head>
<title>Test</title>
</head>
<body>
</body>
</html>

W3C validator reports "Stray end tag ’html’"

I'm baffled at what could be causing the validator error on this page as there's not a lot on this page. The error is on the <html> tag, I get a "Stray end tag html" message. What's wrong?
http://validator.w3.org/check?uri=www.neurologicclinic.net&charset=%28detect+automatically%29&doctype=Inline&group=0
The <html></html> tags should wrap all of the HTML content, including the head tags.
You open an <html> tag after you already had your <head> section. This is invalid. The general order of those tags is as follows:
<html>
<head>
</head>
<body>
</body>
</html>
I believe your <html> tag should be defined above the <head> section, not after it.
e.g.
<!DOCTYPE html>
<html>
<head>
..
</head>
<body>
..
</body>
</html>
You are missing an open <html> tag. It must go before <head>
<!doctype html>
<html>
<head>
...
</head>
...
</html>