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.
What is 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.
<p> tag to add a paragraph of text.<p>This is a paragraph.</p>
<h1> tag creates a main heading.<h1>Welcome to my website</h1>
<a> tag creates a clickable link.<a href="https://example.com">Visit Example</a>
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.
<!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>
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.
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.
Practice
Solution
Step 1: Understand HTML's role
HTML is used to create the structure of a webpage by organizing text, images, and links.Step 2: Differentiate from other technologies
Styling is done by CSS, behavior by JavaScript, and data storage by databases, not HTML.Final Answer:
To give structure and organize content on a webpage -> Option CQuick Check:
HTML = Structure [OK]
- Confusing HTML with CSS or JavaScript
- Thinking HTML stores data
- Believing HTML controls webpage behavior
Solution
Step 1: Identify the standard HTML declaration
The correct way to declare an HTML5 document is with<!DOCTYPE html>at the top.Step 2: Recognize invalid tags
Tags like<html5>,<document>, and<start>are not valid HTML tags.Final Answer:
<!DOCTYPE html> -> Option AQuick Check:
HTML5 starts with <!DOCTYPE html> [OK]
- Using <html5> instead of
- Starting with non-standard tags
- Omitting the doctype declaration
<h1>Welcome</h1> <p>This is a paragraph.</p>
Solution
Step 1: Understand HTML tags used
The<h1>tag creates a large heading, and<p>creates a paragraph.Step 2: Predict browser rendering
The browser shows the heading text 'Welcome' prominently and below it the paragraph text 'This is a paragraph.'Final Answer:
A heading saying 'Welcome' and a paragraph saying 'This is a paragraph.' -> Option AQuick Check:
<h1> + <p> = Heading + Paragraph [OK]
- Expecting raw HTML code to display
- Thinking only one tag will render
- Confusing tag effects
<html> <head> <title>My Page</title> </head> <body> <h1>Hello World</h2> </body> </html>
Solution
Step 1: Check matching tags
The heading starts with<h1>but closes with</h2>, which is incorrect.Step 2: Verify other tags
The<title>,<body>, and<html>tags are correctly used and closed.Final Answer:
The closing tag for the heading is incorrect -> Option DQuick Check:
Matching tags must open and close the same [OK]
- Mismatched opening and closing tags
- Forgetting to close tags
- Misspelling tag names
Solution
Step 1: Check for required document parts
The document must start with<!DOCTYPE html>, have<html>,<head>with<title>, and<body>for content.Step 2: Verify correct tag placement
Head contains metadata like title; body contains visible content like heading and paragraph. <!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>Heading</h1> <p>Paragraph text.</p> </body> </html> follows this structure correctly.Final Answer:
<!DOCTYPE html> <html> <head> <title>Page Title</title> </head> <body> <h1>Heading</h1> <p>Paragraph text.</p> </body> </html> -> Option BQuick Check:
DOCTYPE + head + body = valid HTML page [OK]
- Placing content inside <head> instead of <body>
- Omitting DOCTYPE declaration
- Not closing tags properly
Ready to prove it?
Pass the test and this pattern moves unknown
