HTML Basics: The Structure of a Webpage

Series :

Part 3

Introduction

HTML (HyperText Markup Language) is the backbone of web development. It structures content on the web and provides the foundation for styling with CSS and interactivity with JavaScript. In this article, we’ll explore the basics of HTML and how to create a simple webpage.

What is HTML?

HTML is a markup language that defines the structure of a webpage using elements and tags. These tags tell the browser how to display content, such as headings, paragraphs, images, and links.

Basic Structure of an HTML Document

A basic HTML document consists of the following elements:

<!DOCTYPE html>
<html>
<head>
<title>My First Webpage</title>
</head>
<body>
<h1>Welcome to My Website</h1>
<p>This is my first webpage using HTML.</p>
</body>
</html>

Explanation:

  • <!DOCTYPE html>: Declares the document type as HTML5.
  • <html>: The root element that contains all HTML content.
  • <head>: Contains metadata, title, and links to stylesheets or scripts.
  • <title>: Sets the title of the webpage.
  • <body>: Contains all the visible content of the webpage.
  • <h1>: Defines the main heading.
  • <p>: Represents a paragraph.

Common HTML Elements

Headings

HTML provides six levels of headings:

<h1>Main Heading</h1>
<h2>Subheading</h2>
<h3>Section Title</h3>

Paragraphs and Text Formatting

<p>This is a paragraph.</p>
<strong>Bold text</strong>
<em>Italic text</em>

Links

<a href="https://example.com">Visit Example</a>

Images

<img src="image.jpg" alt="A sample image">

Lists

Ordered List:

<ol>
<li>Item 1</li>
<li>Item 2</li>
</ol>

Unordered List:

<ul>
<li>Item A</li>
<li>Item B</li>
</ul>

Conclusion

HTML is the foundation of web development. Understanding its structure and elements is essential for creating webpages. In the next article, we will explore CSS Basics: Styling Your Webpage.

Facebook
WhatsApp
Twitter
LinkedIn
Pinterest

Leave a Comment

Your email address will not be published. Required fields are marked *

Learn Web Development
Scroll to Top