HTML (HyperText Markup Language) is the foundation of every web page. It structures content like text, images, links, and forms.
1๏ธโฃ Basic HTML Structure
<!DOCTYPE html>
<html>
<head>
<title>My First Page</title>
</head>
<body>
<h1>Hello World!</h1>
<p>This is a paragraph.</p>
</body>
</html>
Explanation:
โฆ
<!DOCTYPE html> โ Declares HTML5โฆ
<html> โ Root elementโฆ
<head> โ Info about the page (title, meta)โฆ
<body> โ Visible content2๏ธโฃ Headings and Paragraphs
<h1>Main Heading</h1>
<h2>Subheading</h2>
<p>This is a paragraph.</p>
3๏ธโฃ Links and Images
<a href="https://google.com">Visit Google</a>
<img src="image.jpg" alt="Image" width="200">
4๏ธโฃ Lists
<ul>
<li>HTML</li>
<li>CSS</li>
</ul>
<ol>
<li>Step 1</li>
<li>Step 2</li>
</ol>
5๏ธโฃ Tables
<table border="1">
<tr>
<th>Name</th>
<th>Age</th>
</tr>
<tr>
<td>Alice</td>
<td>25</td>
</tr>
</table>
6๏ธโฃ Forms
<form>
<input type="text" placeholder="Your name">
<input type="email" placeholder="Your email">
<button type="submit">Submit</button>
</form>
7๏ธโฃ Div & Span
โฆ
<div> โ Block-level containerโฆ
<span> โ Inline container<div style="background: lightgray;">Box</div>
<span style="color: red;">Text</span>
๐ก Practice HTML in a live editor like CodePen or JSFiddle to see instant results!
๐ฌ Tap โค๏ธ for more!