-
Hajipur, Bihar, 844101
HTML stands for HyperText Markup Language. It is the standard language used to create web pages. HTML describes the structure of a webpage using elements (also called tags).
Every HTML document has a basic structure. Here's a complete example:
<!DOCTYPE html>
<html>
<head>
<title>My First HTML Page</title>
</head>
<body>
<h1>Hello, World!</h1>
<p>This is my first paragraph in HTML.</p>
</body>
</html>
Tag | Purpose |
---|---|
<!DOCTYPE html> |
Declares the document type and HTML version |
<html> |
Root element of the HTML document |
<head> |
Contains metadata (like <title> ) |
<title> |
Title of the webpage (appears in browser tab) |
<body> |
Visible content on the page |
<h1> to <h6> |
Headings (from largest to smallest) |
<p> |
Paragraph of text |
This means <HTML>
and <html>
are treated the same. However, it’s best to use lowercase as per modern HTML standards.
HTML elements can be nested (placed inside one another):
<body>
<h2>My Website</h2>
<p>This is a <strong>bold</strong> word inside a paragraph.</p>
</body>
Some elements don’t have closing tags. These are called empty elements. Example:
<br> <!-- Line break -->
<hr> <!-- Horizontal rule -->
Use editors like:
Notepad / Notepad++ (Windows)
VS Code (Cross-platform)
Save the file with a .html
extension and open it in any browser.
Q1. Write a complete HTML document that displays a heading and a paragraph.
Q2. Add the <title>
tag to show "My Website" in the browser tab.
Q3. Use an <h1>
tag to display "Welcome!" on the webpage.
Q4. Create a paragraph using the <p>
tag with any text.
Q5. Add a horizontal line between two paragraphs using <hr>
.
Q6. Insert a line break in a sentence using the <br>
tag.
Q7. Write a nested element: a paragraph with bold text inside it using <strong>
.
Q8. Save your file as basic.html
and open it in a browser.
Q9. Create headings from <h1>
to <h6>
in one HTML page.
Q10. Create an HTML file with two paragraphs and one line break in each.
Q1: What does HTML stand for?
Q2: What is the correct structure for an HTML document?
Q3: Which tag is used to define the main content of a webpage?
Q4: Which HTML element defines the title of the document?
Q5: Which tag is used for inserting a line break?
Q6: HTML tags are:
Q7: What is the purpose of <!DOCTYPE html>?
Q8: Which of the following is an empty element?
Q9: Which element is used to display text in bold?
Q10: Where should the <title> tag be placed?