0
0
HTMLmarkup~5 mins

Role of HTML in web development

Choose your learning style9 modes available
Introduction

HTML is the basic building block of every website. It tells the browser what content to show and how to organize it.

When creating the structure of a webpage like headings, paragraphs, and lists.
When adding images, links, or buttons to a website.
When making content accessible to all users including those using screen readers.
When preparing content that other technologies like CSS and JavaScript will style and make interactive.
When building any web page or web app to display information on the internet.
Syntax
HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Page Title</title>
</head>
<body>
  <!-- Content goes here -->
</body>
</html>
HTML uses tags like <html>, <head>, and <body> to organize content.
The lang attribute helps browsers and screen readers understand the language of the page.
Examples
This creates a large heading on the page.
HTML
<h1>Welcome to my website</h1>
Paragraphs hold blocks of text content.
HTML
<p>This is a paragraph of text.</p>
This creates a clickable link to another website.
HTML
<a href="https://example.com">Visit Example</a>
This adds an image with a description for accessibility.
HTML
<img src="image.jpg" alt="A description of the image">
Sample Program

This webpage shows a heading, a paragraph, a link that opens in a new tab, and a footer. It uses semantic tags for better structure and accessibility.

HTML
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Simple HTML Page</title>
</head>
<body>
  <header>
    <h1>My First Webpage</h1>
  </header>
  <main>
    <section>
      <p>Hello! This is a simple webpage made with HTML.</p>
      <a href="https://www.example.com" target="_blank" rel="noopener noreferrer">Go to Example.com</a>
    </section>
  </main>
  <footer>
    <p>Ā© 2024 My Website</p>
  </footer>
</body>
</html>
OutputSuccess
Important Notes

Always use semantic HTML tags like <header>, <main>, and <footer> to help organize content clearly.

Use the alt attribute on images to describe them for people who cannot see them.

HTML alone does not style or animate content; it only structures it. CSS and JavaScript add style and behavior.

Summary

HTML creates the structure and content of web pages.

It uses tags to organize text, images, links, and other elements.

Good HTML helps browsers and assistive tools show your content correctly.