-
Hajipur, Bihar, 844101
Hajipur, Bihar, 844101
HTML5 Basics
HTML Introduction
HTML Editors
HTML Basic
HTML Elements
HTML Attributes
HTML Headings
HTML Paragraphs
HTML Styles
HTML Formatting
HTML Quotations
HTML Comments
HTML Styling and Design
HTML Links and Media
HTML Layout and Structure
HTML Tables
HTML Lists
HTML Block & Inline
HTML Div
HTML Classes
HTML Id
HTML Head
HTML Layout
HTML Responsive
HTML Computercode
HTML Semantics
HTML Forms
HTML Forms
HTML Form Attributes
HTML Form Elements
HTML Input Types
HTML Input Attributes
Input Form Attributes
HTML Graphics
HTML APIs
HTML Advanced Topics
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.
HTML5 Basics
HTML Introduction
HTML Editors
HTML Basic
HTML Elements
HTML Attributes
HTML Headings
HTML Paragraphs
HTML Styles
HTML Formatting
HTML Quotations
HTML Comments
HTML Styling and Design
HTML Links and Media
HTML Layout and Structure
HTML Tables
HTML Lists
HTML Block & Inline
HTML Div
HTML Classes
HTML Id
HTML Head
HTML Layout
HTML Responsive
HTML Computercode
HTML Semantics
HTML Forms
HTML Forms
HTML Form Attributes
HTML Form Elements
HTML Input Types
HTML Input Attributes
Input Form Attributes
HTML Graphics
HTML APIs
HTML Advanced Topics