top of page

HTML Documents

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

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

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

What is  <!DOCTYPE html>?

The <!DOCTYPE> 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).

The <!DOCTYPE> declaration is not case sensitive.

Let's start practising with excercises.

Example

<!DOCTYPE html>
<html>
<head>
            <title> Coder Stop </title>
</head>
<body>
           <h1> This is a heading </h1>
</body>
</html>

Create a h1 tag display "Hello world".

HTML Headings

The HTML heading are used to display important headings in a webpage.
There are six headings in HTML.
The h1 tag is the largest heading and the h6 tag is the smallest heading.

A Quick Question!

1.Which is the closing tag below?

Let's compare the sizes of all heading tags.

Example

Try it yourself!

HTML paragraph tags are defined as <p> tag.

Example 

<body>
            <p> This is a paragraph. </p>
</body>
The HTML <p> element represents a paragraph. Paragraphs are usually represented in visual media as blocks of text separated from adjacent blocks by blank lines and/or first-line indentation, but HTML paragraphs can be any structural grouping of related content, such as images or form fields.

HTML Link tags are defined as <a> tag.

Example

<body>
           <a href="https://google.com"> This is a link </a>
</body>

The link's destination is specified in the href attribute. 

Attributes are used to provide additional information about HTML elements.

You will learn more about attributes in a later chapter.

<!DOCTYPE html>
<html>
<head>
           <title> Coder Stop </title>
</head>
<body>
           <h1> Hello World </h1>
           <h2> Hello World </h2>
           <h3> Hello World </h2>
           <h4> Hello World </h4>
           <h5> Hello World </h5>
           <h6> Hello World </h6>
</body>
</html>
bottom of page