HTML for beginners

HTML (HyperText Markup Language) is the backbone of the web. It is the standard language used to create and design web pages. In this tutorial, we will explore the basics of HTML to get you started on your web development journey.

What Is HTML?

HTML is a markup language used to structure content on the web. It consists of a series of elements represented by tags that define different parts of a webpage.

Basic Structure of an HTML Document

Here is the basic structure of an HTML document:

<!DOCTYPE html>
<html>
<head>
    <title>My First HTML Page</title>
</head>
<body>
    <h1>Welcome to HTML</h1>
    <p>This is a paragraph of text.</p>
</body>
</html>

Explanation:

  • <!DOCTYPE html>: Declares the document type as HTML5.
  • <html>: The root element that contains all HTML content.
  • <head>: Contains metadata like the title and links to stylesheets.
  • <body>: Contains the visible content of the webpage.

Common HTML Tags

Here are some commonly used HTML tags:

  • <h1> to <h6>: Headings of different sizes.
  • <p>: Paragraphs.
  • <a href="url">: Links.
  • <img src="image.jpg" alt="description">: Images.
  • <ul> <li>: Unordered lists.
  • <ol> <li>: Ordered lists.

Creating Your First HTML Page

To create your first HTML page:

  1. Open a text editor (e.g., Notepad, VS Code).
  2. Type the basic structure of an HTML document.
  3. Save the file with a .html extension (e.g., index.html).
  4. Open the file in a web browser to view your page.

Next Steps

Explore more HTML elements and practice creating different web pages. HTML is the first step in web development, and mastering it will pave the way for learning CSS and JavaScript. Happy coding! If you want to learn more about html you can start learning about forms!