HTML is the language that tells a web browser how to show a webpage. It gives structure to the content you see on the internet.
0
0
What is HTML
Introduction
When you want to create a webpage to share information.
When you need to add text, images, or links to a website.
When you want to build the basic layout of a website before adding styles or interactivity.
When you want to make content readable by browsers and accessible to everyone.
When you want to organize content into headings, paragraphs, lists, and sections.
Syntax
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Page Title</title> </head> <body> <!-- Your content goes here --> </body> </html>
The <!DOCTYPE html> tells the browser this is an HTML5 document.
The <html> tag wraps all the content on the page.
Examples
Use the
<p> tag to add a paragraph of text.HTML
<p>This is a paragraph.</p>
The
<h1> tag creates a main heading.HTML
<h1>Welcome to my website</h1>
The
<a> tag creates a clickable link.HTML
<a href="https://example.com">Visit Example</a>
Sample Program
This simple webpage shows a heading, a paragraph, and a link. It uses basic HTML tags and includes accessibility with an aria-label on the link.
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> <h1>Hello, World!</h1> <p>This is my first webpage using HTML.</p> <a href="https://www.example.com" aria-label="Example website link">Go to Example.com</a> </body> </html>
OutputSuccess
Important Notes
Always include the lang attribute in the <html> tag to help screen readers.
Use semantic tags like <h1>, <p>, and <a> to organize content clearly.
Test your HTML in a browser to see how it looks and works.
Summary
HTML is the building block of webpages, giving structure to content.
It uses tags like <h1>, <p>, and <a> to organize text and links.
Every webpage starts with a basic HTML structure including <!DOCTYPE html> and <html> tags.