0% found this document useful (0 votes)
19 views2 pages

In This Chapter We Will Show Some Basic HTML Examples

This chapter provides basic examples of HTML, detailing the structure of an HTML document which starts with a <!DOCTYPE html> declaration and includes <html>, <body>, and heading tags. It explains the importance of the <!DOCTYPE> declaration for browser compatibility and introduces HTML headings from <h1> to <h6>. The chapter includes sample code for creating a simple HTML page with headings and paragraphs.

Uploaded by

ampairejosephk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views2 pages

In This Chapter We Will Show Some Basic HTML Examples

This chapter provides basic examples of HTML, detailing the structure of an HTML document which starts with a <!DOCTYPE html> declaration and includes <html>, <body>, and heading tags. It explains the importance of the <!DOCTYPE> declaration for browser compatibility and introduces HTML headings from <h1> to <h6>. The chapter includes sample code for creating a simple HTML page with headings and paragraphs.

Uploaded by

ampairejosephk
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

In this chapter we will show some basic HTML examples.

Don't worry if we use tags you have not learned about yet.

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>.

<!DOCTYPE html>
<html>
<body>

<h1>My First Heading</h1>


<p>My first paragraph.</p>

</body>
</html>

The <!DOCTYPE> Declaration


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.

The <!DOCTYPE> declaration for HTML5 is:

<!DOCTYPE html>

HTML Headings
HTML headings are defined with the <h1> to <h6> tags.

<h1> defines the most important heading. <h6> defines the least important heading:

<h1>This is heading 1</h1>


<h2>This is heading 2</h2>
<h3>This is heading 3</h3>

Example

<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>This is a Heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

You might also like