What is the correct way to use start tag when creating with HTML5
IE: HTML 4 Strict is like this
You use...
<!DOCTYPE html>
followed by your HTML tag etc..
<!-- simplified doctype works for all previous versions of HTML as well -->
<!doctype html>
Learning Resource:
The standard has been simplified because the previous doctypes were too cryptic. The new doctype is simply <!DOCTYPE html>
. You may wonder why it is not <!DOCTYPE html5>
but it is simply because it is just an update to the standard of HTML and not a new version of anything. As you can see below, all elements can now have a language attribute.
The
<html>
element is the root element of a document. Every document must begin with this element, and it must contain both the<head>
and<body>
elements.It is considered good practice to specify the primary language of the document on this element using the lang attribute.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
<p>
Jamie was here.
</p>
</body>
</html>
More info: https://dev.w3.org/html5/html-author/#doctype-declaration
According to the WWW Consortium, the organization responsible setting current web standards, no one has answered this correctly. The current standard for language declaration is
Always use a language attribute on the html tag to declare the default language of the text in the page. When the page contains content in another language, add a language attribute to an element surrounding that content. Use the lang attribute for pages served as HTML, and the xml:lang attribute for pages served as XML. For XHTML 1.x and HTML5 polyglot documents, use both together.
W3C HTML Language Tag Page
Here is the answer regarding DOCTYPE declaration
Use the following markup as a template to create a new HTML document using a proper Doctype declaration. See the list below if you wish to use another DTD.
W3C DOCTYPE Standards
<!DOCTYPE html>
<html>
<head>
<title>An HTML standard template</title>
<meta charset="utf-8" />
</head>
<body>
<p>… Your HTML content here …</p>
</body>
</html>
Hope this helps.