Welcome to the basics of HTML, the standard markup language for creating web pages. Below, you will find an overview of the fundamental elements and structure of HTML documents.
Structure of an HTML Document
An HTML document consists of three main parts:
Doctype Declaration: This declaration defines the document type and version of HTML. For HTML5, it is
<!DOCTYPE html>
.HTML Element: This is the root element that contains all the content of the document.
Head Element: This element contains meta-information about the document, such as the title, links to CSS files, and other metadata.
Body Element: This element contains the content of the document, such as text, images, links, and other HTML elements.
<!DOCTYPE html>
<html>
<head>
<title>HTML Basics</title>
</head>
<body>
<!-- Content goes here -->
</body>
</html>
Basic HTML Elements
Here are some of the most common HTML elements:
<h1>
to<h6>
: These elements represent headings.<h1>
is the largest, and<h6>
is the smallest.<p>
: This element represents a paragraph of text.<a>
: This element represents a hyperlink. It is used to create links to other web pages.<img>
: This element is used to embed images into web pages.<ul>
,<ol>
,<li>
: These elements are used to create unordered and ordered lists.
Example
Here's an example of a simple HTML document with some content:
<!DOCTYPE html>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is my first HTML page.</p>
<a href="/en/docs/getting_started">Learn more about HTML</a>
<img src="https://cloud-image.ullrai.com/q/html_logo/" alt="HTML Logo"/>
</body>
</html>
In this example, we have a heading, a paragraph, a link to another page, and an image.
Further Reading
For more information on HTML, you can visit the following resources:
Please note that the images and links provided are for illustrative purposes only and may not be available or accurate.