HTML Basic Examples

All HTML documents must start with a document type declaration: <!DOCTYPE html> .

The HTML document itself begins with <html> and ends with </html>


Example

<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>
<p>My first paragraph.</p >

</body>
</html>

The <!DOCTYPE html> Declaration

The <!DOCTYPE html> declaration represents the document type, and helps browsers to display web pages correctly.
It must only appear once, at the top of the page (before any HTML tags).

<!DOCTYPE html>