Zami Coskula
Zami Coskula

Reputation: 53

What does Stray start tag html error mean?

So I made this simple HTML code so far and it's already giving errors with the Validator! I don't understand what's wrong, can someone help?

<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<html lang="en">
	</html>
	<title>Otsikko</title>
</head>
<body>
	<h1> Otsikko </h1>
	<h2> Otsikko </h2>
	<p>Tekstiä</p>
	<ul>
		<li>Jotain</li>
		<li>Jotain</li>
		<li>Jotain</li>
	</ul>
	<ol>
		<li>Jotain</li>
		<li>Jotain</li>
		<li>Jotain</li>
	</ol>
	<dl> <dt>Jotain</dt>
		<dd>Jotain</dd> <dt>Jotain</dt>
	</dl>
    &auml; &ouml; &laquo; &reg;
</body>
</html>

What's wrong with this HTML code?

Upvotes: 0

Views: 6384

Answers (1)

dustytrash
dustytrash

Reputation: 1590

You should get rid of these at the end: &auml; &ouml; &laquo; &reg;

Move </html> to the end of the document (keep the opening tag where it is)

add a <head> </head> around your title and charset.

The <dt> tag should have a <dd> tag follow it. (First one did, second didn't)

Although not an error, for language accents such as ä you can use the HTML code such as &auml;. See: https://www.starr.net/is/type/htmlcodes.html

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Otsikko</title>
</head>
<h1> Otsikko </h1>
<h2> Otsikko </h2>
<p> Teksti&auml; </p>
<ul>
    <li>Jotain</li>
    <li>Jotain</li>
    <li>Jotain</li>
</ul>
<ol>
    <li>Jotain</li>
    <li>Jotain</li>
    <li>Jotain</li>
</ol>
<dl>
    <dt>Jotain</dt>
    <dd>Jotain</dd>
    <dt>Jotain</dt>
    <dd>Jotain</dd>
</dl>
</html>

W3 has a good online validator:

https://validator.w3.org/

Upvotes: 0

Related Questions