Advertisement
❮ Previous: HTML Editors Next: HTML Elements ❯

HTML Basics

HTML Documents

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

The HTML document with <html> and ends with </html>.

The visible part of the HTML document is within <body> and </body>.

Example

<!DOCTYPE html>
<html>
<body>

<h1>Heading of the page</h1>
<p>Paragraph of the page.</p>

</body>
</html>

Try this code ❯


The <!DOCTYPE> Declaration

The <!DOCTYPE> declaration represents the document type.

Note: The <!DOCTYPE> declaration is not case sensitive.

The <!DOCTYPE> declaration for HTML5 is:

<!DOCTYPE html>

HTML Headings

The <h1> to <h6> HTML elements represent six levels of headings. <h1> is the highest level and <h6> is the lowest.

Example

<h1>Hello World!</h1>
<h2>Hello World!</h2>
<h3>Hello World!</h3>
<h4>Hello World!</h4>
<h5>Hello World!</h5>
<h6>Hello World!</h6>

Try this code ❯


Advertisement

HTML Paragraphs

HTML <p> element defines a paragraphs for the document.

Example

<p>Paragraph of the page.</p>

Try this code ❯


HTML Links

HTML <a> element defines a links(hyperlink) for the document.

The href attribute is used to specify destination for the link.

Example

<a href="https://www.google.com" >Visit Google.com</a>

Try this code ❯


HTML Images

HTML <img> element defines a images for the document.

Example

<img src="flowers.jpg" alt="Alternative text" width="300" height="150">

Try this code ❯

Attributes

❮ Previous: HTML Editors Next: HTML Elements ❯
Advertisement