DEV Community

Cover image for What is HTML? A Beginner’s Guide to Building Web Pages
Abdelhakim Baalla
Abdelhakim Baalla

Posted on • Edited on

3 1 2 2 1

What is HTML? A Beginner’s Guide to Building Web Pages

What is HTML? A Beginner’s Guide to Building Web Pages

If you’re new to web development, HTML is the perfect place to start. It’s the foundation of every website you visit, and learning it is the first step toward becoming a web developer. In this guide, we’ll cover everything you need to know about HTML, from what it is to how to create your first web page.


What is HTML?

HTML stands for HyperText Markup Language. It’s the standard language used to create and structure content on the web. HTML uses tags to define elements like headings, paragraphs, images, links, and more. These elements are the building blocks of every website.


Why Learn HTML?

  • It’s Essential: Every website uses HTML. Without it, the web wouldn’t exist as we know it.
  • Easy to Learn: HTML has a simple syntax, making it beginner-friendly.
  • Foundation for Other Technologies: Once you know HTML, you can easily learn CSS and JavaScript to create dynamic and stylish websites.

Basic Structure of an HTML Document

Every HTML document follows a standard structure. Here’s an example:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My First Web Page</title>
</head>
<body>
    <h1>Welcome to My Website</h1>
    <p>This is my first web page. I’m learning HTML!</p>
</body>
</html>
Enter fullscreen mode Exit fullscreen mode

Common HTML Tags

Here are some of the most commonly used HTML tags:

  1. Headings Headings are used to define titles and subtitles. There are six levels of headings.
<h1>This is a Heading 1</h1>
<h2>This is a Heading 2</h2>
<h3>This is a Heading 3</h3>
Enter fullscreen mode Exit fullscreen mode
  1. Paragraphs

The p tag is used to define paragraphs of text.

<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
Enter fullscreen mode Exit fullscreen mode
  1. Links

The a tag is used to create hyperlinks. Use the href attribute to specify the link’s destination.

<a href="https://www.example.com">Visit Example.com</a>
Enter fullscreen mode Exit fullscreen mode
  1. Images The img tag is used to embed images. Use the src attribute to specify the image file and the alt attribute to provide alternative text.
<img src="image.jpg" alt="A description of the image">
Enter fullscreen mode Exit fullscreen mode
  1. Lists HTML supports both ordered ol and unordered ul lists.
<ul>
    <li>Item 1</li>
    <li>Item 2</li>
</ul>

<ol>
    <li>First Item</li>
    <li>Second Item</li>
</ol>
Enter fullscreen mode Exit fullscreen mode
  1. Divisions The div tag is used to group elements together for styling or layout purposes.
<div>
    <p>This is a paragraph inside a div.</p>
</div>
Enter fullscreen mode Exit fullscreen mode

Creating Your First Web Page

Let’s put everything together and create a simple web page:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My First Web Page</title>
</head>
<body>
    <h1>Welcome to My Website</h1>
    <p>This is my first web page. I’m learning HTML!</p>
    <a href="https://www.example.com">Visit Example.com</a>
    <img src="image.jpg" alt="A beautiful landscape">
</body>
</html>
Enter fullscreen mode Exit fullscreen mode

Save this code in a file with the extension .html (e.g., index.html).

Open the file in your browser to see your web page in action!

Tips for Learning HTML

Practice Regularly: The more you code, the better you’ll get.

Use Online Resources: Websites like MDN Web Docs and W3Schools are great for learning HTML.

Experiment: Try creating different types of web pages to see what you can build.

Conclusion

HTML is the foundation of web development, and learning it is the first step toward building your own websites. With this guide, you’ve learned the basics of HTML, including its structure, common tags, and how to create your first web page. Keep practicing, and soon you’ll be ready to move on to CSS and JavaScript!


Follow Me for More!

If you found this guide helpful, feel free to follow me for more tutorials, tips, and insights on web development and programming:

Let’s connect and grow together! 🚀

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (1)

Collapse
 
lisw05 profile image
Shengwei Li

Good work!

Playwright CLI Flags Tutorial

5 Playwright CLI Flags That Will Transform Your Testing Workflow

  • 0:56 --last-failed: Zero in on just the tests that failed in your previous run
  • 2:34 --only-changed: Test only the spec files you've modified in git
  • 4:27 --repeat-each: Run tests multiple times to catch flaky behavior before it reaches production
  • 5:15 --forbid-only: Prevent accidental test.only commits from breaking your CI pipeline
  • 5:51 --ui --headed --workers 1: Debug visually with browser windows and sequential test execution

Learn how these powerful command-line options can save you time, strengthen your test suite, and streamline your Playwright testing experience. Click on any timestamp above to jump directly to that section in the tutorial!

Watch Full Video 📹️

👋 Kindness is contagious

DEV is better (more customized, reading settings like dark mode etc) when you're signed in!

Okay