Demystifying HTML Structure: A Core Web Development Introduction

Published on 30th of May, Author: Rajneesh Chaudhary

Introduction

HTML, or HyperText Markup Language, is the standard language used to create web pages. If you’re new to web development, understanding HTML is essential. In this tutorial, we will explore the basic structure of an HTML document, the key elements involved, and how to create a simple webpage.

Prerequisites

Before we dive into the tutorial, here are a few things you should have:

  • A basic understanding of how to use a text editor (like Notepad or VSCode).
  • A web browser (like Chrome, Firefox, or Safari) to view your HTML files.
  • A willingness to learn and experiment with code!

Step-by-Step Guide

Let’s start by creating a simple HTML document. Follow these steps:

  1. Open your text editor: Launch your preferred text editor.
  2. Create a new file: Save it as index.html.
  3. Write the basic HTML structure: Copy and paste the following code into your file:
<!DOCTYPE html>
<html>
<head>
    <title>My First Webpage</title>
</head>
<body>
    <h1>Welcome to My Webpage</h1>
    <p>This is my first attempt at creating a webpage using HTML.</p>
</body>
</html>
  1. Save your file: Make sure to save your changes.
  2. Open your HTML file in a web browser: Right-click on the file and select “Open with” followed by your browser of choice.

You should see a simple webpage displaying a heading and a paragraph!

Explanation of the Code

Let’s break down the code you just wrote:

  • <!DOCTYPE html>: This declaration defines the document type and version of HTML.
  • <html>: This tag wraps all the content on the webpage.
  • <head>: Contains meta-information about the document, such as the title.
  • <title>: Sets the title of the webpage, which appears in the browser tab.
  • <body>: This is where the visible content of the webpage goes.
  • <h1>: Represents the main heading of the page.
  • <p>: Defines a paragraph of text.

Each of these elements plays a crucial role in structuring your webpage.

Conclusion

Congratulations! You’ve just created your first HTML webpage. Understanding the basic structure of HTML is the first step towards becoming a web developer. As you continue to learn, you can explore more complex elements and attributes to enhance your webpages.

For further reading and resources, check out the following links:

  • https://medium.com/@rajneeshrehsaan48/sliding-window-and-prefix-sum-techniques-6-essential-interview-problems-solved-in-c-a1f8f76017be?source=rss——algorithms-5″>HTML Basics
  • Continue reading on Medium »”>Advanced HTML Techniques

Keep practicing, and soon you’ll be building more complex and interactive web pages!

Source: Original Article