Robert Watkin
3 min readSep 23, 2023

--

In today’s digital age, understanding the fundamentals of web development is more valuable than ever.

Photo by Clément Hélardot on Unsplash

One of the essential building blocks of web development is HTML (Hypertext Markup Language). HTML is the language that web browsers use to render web pages.

If you’re a beginner looking to dip your toes into web development, you’ve come to the right place. In this guide, we’ll walk you through the process of creating a basic HTML document step by step.

What is HTML?

HTML is the backbone of any web page. It is a markup language that structures content on the web, allowing browsers to display text, images, links, and more. HTML uses a system of tags and attributes to define the elements on a webpage. These elements are the building blocks of web content and include headings, paragraphs, images, and links.

Getting Started

Before we start coding, you'll need a plain text editor to write your HTML code. You can use simple editors like Notepad on Windows or TextEdit on macOS. Alternatively, you can use code editors like Visual Studio Code, Sublime Text, or Atom, which provide features like syntax highlighting and code autocompletion.

The Basic Structure of an HTML Document

Every HTML document has a basic structure that includes:

<!DOCTYPE html>
<html>
<head>
<title>Your Page Title</title>
</head>
<body>
<!-- Your content goes here -->
</body>
</html>

Let’s break this down:

  • `<!DOCTYPE html>`: This declaration tells the browser that you’re using HTML5, the latest version of HTML.
  • `<html>`: This is the root element of an HTML document. It contains all the other HTML elements.
  • `<head>`: This section contains metadata about the document, such as the page title (what appears in the browser tab) and links to external resources like stylesheets and scripts.
  • `<title>`: The title element sets the title of your webpage, which appears in the browser’s title bar or tab.
  • `<body>`: This is where the main content of your webpage resides, such as text, images, and links.

Adding Content

Now that you have the basic structure, you can start adding content. Here are a few common HTML elements to get you started:

  • `<h1>` to `<h6>`: Headings of various sizes, with `<h1>` being the largest and `<h6>` the smallest.
  • `<p>`: Paragraphs of text.
    - `<a href="URL">Link Text</a>`: Links to other web pages.
  • `<img src="image.jpg" alt="Image Description">`: Images.

Saving and Viewing Your HTML Document

Once you've created your HTML document, save it with the ".html" file extension (e.g., "index.html"). You can then open it in a web browser to see your web page in action.

Conclusion

Congratulations! You've just created your first basic HTML document. While this is just the beginning of your journey into web development, it's an essential step that forms the foundation for building more complex and interactive web pages.

As you continue to explore HTML and web development, you'll discover the limitless possibilities for creating and sharing content on the web. Happy coding!

--

--

Robert Watkin

Hi! I am the creator of www.portfolio-hub.co.uk — a blog and hopefully soon will also be a SaaS aimed to help investors and personal finance enthusiasts 😁