Welcome to the HTML Basics Tutorial! This guide will help you understand the fundamentals of HTML, the standard markup language for creating web pages.
Table of Contents
- Introduction to HTML
- Basic HTML Structure
- Elements and Attributes
- Formatting Text
- Images and Links
- Further Reading
Introduction to HTML
HTML (HyperText Markup Language) is the backbone of the web. It defines the structure and content of a web page. HTML uses tags to define elements such as headings, paragraphs, images, and links.
Basic HTML Structure
Every HTML document starts with a <!DOCTYPE html>
declaration, followed by the opening <html>
tag. Inside the <html>
tag, there are two main sections: the <head>
and the <body>
.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
Elements and Attributes
HTML elements are defined by tags. For example, <h1>
defines a heading, and <p>
defines a paragraph. Elements can have attributes, which provide additional information about the element.
<h1 class="title">This is a Heading with a Class</h1>
<p id="para1">This is a paragraph with an ID.</p>
Formatting Text
HTML provides various elements to format text, such as bold (<b>
) and italic (<i>
) tags.
<b>This is bold text.</b>
<i>This is italic text.</i>
Images and Links
HTML allows you to insert images and links into your web pages.
<img src="image.jpg" alt="Description">
<a href="https://www.example.com">Visit Example.com</a>
Further Reading
For more information on HTML, check out our Advanced HTML Tutorial.