Student: Majharul Islam | ID: 232002256 | Date: October 2025
HTML (HyperText Markup Language) is the standard markup language for creating web pages and web applications. It describes the structure of a web page using markup elements.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Page Title</title>
</head>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
| Element | Purpose | Description |
|---|---|---|
| <!DOCTYPE html> | Document Type Declaration | Tells browser this is HTML5 document |
| <html> | Root Element | Contains all other HTML elements |
| <head> | Document Head | Contains metadata and page information |
| <body> | Document Body | Contains visible page content |
<!DOCTYPE html>
The DOCTYPE declaration tells the browser which version of HTML the page is written in. HTML5 uses the simple declaration above.
<tagname attribute="value">Content</tagname>
<!-- Heading Element -->
<h1>Welcome to HTML</h1>
<!-- Paragraph Element -->
<p>This is a paragraph with <strong>bold text</strong>.</p>
<!-- Element with Attributes -->
<a href="https://example.com" target="_blank">Visit Example</a>
<!-- Self-closing Element -->
<img src="image.jpg" alt="Description">
| Attribute | Description | Example |
|---|---|---|
| id | Unique identifier for an element | <div id="header"> |
| class | CSS class name(s) for styling | <p class="highlight"> |
| style | Inline CSS styling | <h1 style="color: blue;"> |
| title | Tooltip text for element | <img title="Photo description"> |
| lang | Language of the content | <html lang="en"> |
<h1>Heading 1 - Most Important</h1>
<h2>Heading 2 - Second Level</h2>
<h3>Heading 3 - Third Level</h3>
<h4>Heading 4 - Fourth Level</h4>
<h5>Heading 5 - Fifth Level</h5>
<h6>Heading 6 - Least Important</h6>
This is a paragraph element. It contains text content and can include other inline elements.
Another paragraph with strong text, emphasized text, and a link.
<p>This is a paragraph element.</p>
<p>Text with <strong>strong text</strong> and <em>emphasized text</em>.</p>
<!-- This is an HTML comment -->
<!-- Comments are not displayed in the browser -->
<!-- They are useful for documentation and debugging -->
<h1>Visible Content</h1>
<!-- <h2>Hidden Content</h2> -->