HTML Basics: Structure & Elements Guide
HTML Basics: Structure & Elements Guide
✅ Interview Q&A
Q1: What is HTML?
A: HTML is a markup language used to create the structure of web pages.
It tells the browser how to display content like text, images, links, etc.
✅ Interview Q&A
Q1: What is the role of a browser?
A: Browser HTML, CSS, JavaScript ko interpret karke user ke saamne
website render karta hai.
✅ Interview Q&A
Q1: What is the latest version of HTML?
A: HTML5
✅ Interview Q&A
Q1: Which software is required to run HTML?
A: Sirf ek browser, because HTML runs directly in browser. (No compiler
needed)
Breakdown:
<!DOCTYPE html> → Browser ko batata hai ki ye HTML5 document hai.
<html> → Root element (sab kuch iske andar hota hai).
<head> → Metadata, title, CSS, scripts.
<body> → Actual visible content (text, images, etc.).
✅ Interview Q&A
Q1: Why do we use <!DOCTYPE html>?
A: It tells the browser that the document is written in HTML5.
📘 2. Basic Elements
2.1 Headings (<h1> – <h6>)
👉 Headings ka use content ko title aur sub-title banane ke liye hota hai.
Range: <h1> sabse bada heading, <h6> sabse chhota.
SEO ke liye <h1> tag ek page me ek hi bar use karna best practice hai.
Example:
<h1>Main Heading</h1>
<h2>Sub Heading</h2>
<h3>Section Title</h3>
✅ Interview Q&A
Q1: How many heading tags are in HTML?
A: 6 headings tags (<h1> to <h6>).
✅ Interview Q&A
Q1: Difference between <p> and <br>?
A: <p> is for paragraphs (block-level element, with spacing
before/after), while <br> is used for line breaks inside text (inline).
✅ Interview Q&A
Q1: Is <br> a self-closing tag?
A: Yes, <br> is an empty tag (no closing tag needed).
Example:
<p><b>Bold</b> vs <strong>Strong</strong></p>
<p><i>Italic</i> vs <em>Emphasized</em></p>
<p><u>Underline</u></p>
<p>2<sup>5</sup> = 32</p>
<p>H<sub>2</sub>O is water.</p>
✅ Interview Q&A
Q1: Difference between <b> and <strong>?
A: <b> only makes text bold (visual), but <strong> gives semantic
meaning (important text for SEO & screen readers).
✅ Interview Q&A
Q1: Can comments be nested in HTML?
A: No, HTML does not support nested comments.
Types:
Absolute URL → Full web address (external site).
<a href="[Link] to Google</a>
Target Attribute
_self → same tab (default)
_blank → new tab me open karega
<a href="[Link] target="_blank">Open in new tab</a>
✅ Interview Q&A
Q1: What is the difference between absolute and relative links?
A: Absolute link full path ([Link] deta hai, jabki relative link
current directory/project ke andar file ko locate karta hai.
Attributes:
src → Image ka path (source)
alt → Alternative text (jab image load na ho)
width, height → Size set karna
Example:
<img src="images/[Link]" alt="My Photo" width="300" height="200">
👉 Path Types:
Relative Path: images/[Link] (same project ke andar)
Absolute Path: [Link]
✅ Interview Q&A
Q1: Why do we use alt attribute?
A: Accessibility (screen readers ke liye) aur jab image load na ho to
alternative text show ho.
Q2: What is the difference between relative and absolute image path?
A: Relative = project ke andar ki file, Absolute = full URL.
Audio Example:
<audio controls>
<source src="song.mp3" type="audio/mpeg">
Your browser does not support audio.
</audio>
Video Example:
<video width="400" controls autoplay loop>
<source src="movie.mp4" type="video/mp4">
Your browser does not support video.
</video>
Important Attributes:
controls → play/pause buttons dikhata hai
autoplay → automatic play karega
loop → repeat hota rahega
✅ Interview Q&A
Q1: Can HTML5 play audio/video without plugins?
A: Yes, HTML5 supports native audio/video playback, no external plugins like
Flash needed.
YouTube Video:
<iframe width="560" height="315"
src="[Link]
frameborder="0" allowfullscreen></iframe>
Google Maps:
<iframe
src="[Link]
</iframe>
PDF File:
<iframe src="[Link]" width="600" height="400"></iframe>
✅ Interview Q&A
Q1: What is an <iframe>?
A: An inline frame used to embed another HTML page, video, map, or document
inside the current page.
👉 Attributes Example:
<ol type="A" start="3">
<li>First</li>
<li>Second</li>
</ol>
✅ Interview Q&A
Q1: What is the default type of <ol>?
A: Numeric (1, 2, 3...).
disc (default)
circle
square
none
✅ Interview Q&A
Q1: Difference between <ol> and <ul>?
A: <ol> is for ordered (numbered) lists, <ul> is for unordered (bulleted)
lists.
Example:
<dl>
<dt>HTML</dt>
<dd>HyperText Markup Language</dd>
<dt>CSS</dt>
<dd>Cascading Style Sheets</dd>
</dl>
✅ Interview Q&A
Q1: What tags are used in description list?
A: <dl>, <dt>, <dd>.
✅ Interview Q&A
Q1: Can we nest <ul> inside <ol>?
A: Yes, we can nest any type of list inside another list item.
📘 5. Tables
5.1 Table Structure (<table>, <tr>, <td>, <th>)
Example:
<table border="1">
<tr>
<th>Name</th>
<th>Age</th>
<th>City</th>
</tr>
<tr>
<td>Ramesh</td>
<td>25</td>
<td>Agra</td>
</tr>
<tr>
<td>Suresh</td>
<td>30</td>
<td>Delhi</td>
</tr>
</table>
✅ Interview Q&A
Example:
✅ Interview Q&A
👉 Rowspan aur Colspan ka use cells ko merge karne ke liye hota hai.
Example:
<table border="1">
<tr>
<th>Name</th>
<th colspan="2">Subjects</th>
</tr>
<tr>
<td>Ramesh</td>
<td>Math</td>
<td>Science</td>
</tr>
<tr>
<td rowspan="2">Suresh</td>
<td>English</td>
<td>History</td>
</tr>
<tr>
<td>Geography</td>
<td>Economics</td>
</tr>
</table>
✅ Interview Q&A
Example:
<table border="1">
<caption>Student Marks Table</caption>
<tr>
<th>Name</th>
<th>Marks</th>
</tr>
<tr>
<td>Amit</td>
<td>85</td>
</tr>
</table>
✅ Interview Q&A
👉 Next step me kya tum chahte ho main HTML Forms (input, textarea, select, button,
attributes) start karun?
You said:
Start with below topics
6. Forms
6.1 Form basics (<form>, action, method GET/POST)
6.2 Input types: text, password, email, number, radio, checkbox, file,
hidden, date, range, color
6.3 <label>, <textarea>
6.4 <select>, <option> (dropdowns)
6.5 <fieldset>, <legend> (grouping)
6.6 Buttons (<button>, submit, reset)
6.7 Form validation attributes (required, pattern, min, max, maxlength,
placeholder)
ChatGPT said:
Perfect 👌 ab hum HTML ka Forms topic start karte hain. Ye sabse important chapter
hai kyunki har website me login, signup, search bar, feedback form, payment form
hota hi hai.
📘 6. Forms
6.1 Form Basics (<form>, action, method GET/POST)
👉 Form ka use user input lene ke liye hota hai (login, register, search, etc.).
Example:
👉 GET vs POST
✅ Interview Q&A
GET → Data visible in URL, limited length, used for search queries.
👉 Input fields ka use different data collect karne ke liye hota hai.
<form>
Text: <input type="text" name="username"><br>
Password: <input type="password" name="pass"><br>
Email: <input type="email" name="email"><br>
Number: <input type="number" min="1" max="10"><br>
Radio: <input type="radio" name="gender" value="M"> Male
<input type="radio" name="gender" value="F"> Female<br>
Checkbox: <input type="checkbox" name="hobby" value="sports"> Sports
<input type="checkbox" name="hobby" value="music"> Music<br>
File: <input type="file" name="resume"><br>
Hidden: <input type="hidden" name="id" value="123"><br>
Date: <input type="date" name="dob"><br>
Range: <input type="range" min="0" max="100"><br>
Color: <input type="color" name="favcolor"><br>
</form>
✅ Interview Q&A
Radio → select only one option (from group with same name).
👉 <label> → Better accessibility, label click karne se input activate hota hai.
<label for="username">Username:</label>
<input type="text" id="username" name="username">
✅ Interview Q&A
<select name="city">
<option value="agra">Agra</option>
<option value="delhi">Delhi</option>
<option value="mumbai">Mumbai</option>
</select>
👉 Multiple Selection:
✅ Interview Q&A
<fieldset>
<legend>Personal Information</legend>
Name: <input type="text"><br>
Age: <input type="number">
</fieldset>
✅ Interview Q&A
👉 Types:
✅ Interview Q&A
Example:
<form>
Username: <input type="text" required><br>
Email: <input type="email" placeholder="example@[Link]"><br>
Age: <input type="number" min="18" max="60"><br>
Password: <input type="password" pattern="[A-Za-z0-9]{6,}"
title="At least 6 characters"><br>
<input type="submit">
</form>
✅ Interview Q&A
Q1: How is client-side validation achieved in HTML5?
A: Using attributes like required, pattern, min, max, maxlength, type=email, etc.
✨ Ab tumhe Forms basics, inputs, labels, textarea, select, fieldset, buttons, aur
validation clear ho gaye. Ye interview me bahut frequently pucha jata hai.
👉 Kya tum chahte ho main next topic: Semantic HTML (header, footer, section,
article, nav, aside) shuru karu?
You said:
Start with below topics
7. Semantic & Structural Elements
7.1 <header>, <footer>
7.2 <main>, <section>
7.3 <article>, <aside>
7.4 <nav>
7.5 Inline semantics: <mark>, <time>, <abbr>, <cite>
7.6 Interactive: <details>, <summary>
7.7 Indicators: <progress>, <meter>
ChatGPT said:
Bahut badiya 👍 ab hum aate hain Semantic & Structural Elements par.
HTML5 ne semantic tags introduce kiye jo content ko meaning dete hain (sirf
structure nahi). Ye SEO aur accessibility (screen readers) dono ke liye important
hote hain.
👉 <header> – Page ya section ka top part hota hai (logo, title, nav, search bar).
👉 <footer> – Page ya section ka bottom part hota hai (copyright, contact info,
links).
Example:
<header>
<h1>My Website</h1>
<nav> ...menu... </nav>
</header>
<footer>
<p>© 2025 MyWebsite | All Rights Reserved</p>
</footer>
✅ Interview Q&A
Q1: Difference between <header> and <head>?
A: <head> me metadata hota hai (title, CSS, JS) jo browser ke liye hai. <header> me
visible content hota hai jo user ke liye hai.
Example:
<main>
<section>
<h2>About Us</h2>
<p>We are a software company...</p>
</section>
</main>
✅ Interview Q&A
Q1: Can a page have multiple <main> tags?
A: No, only one <main> allowed per page.
Example:
<article>
<h2>HTML Tutorial</h2>
<p>This is a complete guide on HTML...</p>
</article>
<aside>
<h3>Related Posts</h3>
<ul>
<li>Learn CSS</li>
<li>Learn JavaScript</li>
</ul>
</aside>
✅ Interview Q&A
Q1: When should we use <article>?
A: For independent, reusable content that can be shared outside the site (like RSS
feeds).
7.4 <nav>
Example:
<nav>
<a href="[Link]">Home</a>
<a href="[Link]">About</a>
<a href="[Link]">Contact</a>
</nav>
✅ Interview Q&A
Q1: Is <nav> mandatory for all links?
A: No, only for major navigation blocks. Footer ke chhote links ke liye zaroori
nahi hai.
<cite> → Citation/reference
Example:
✅ Interview Q&A
Q1: Difference between <b> and <mark>?
A: <b> sirf bold styling deta hai, <mark> text ko highlight karta hai with meaning
(important point).
Example:
<details>
<summary>More Information</summary>
<p>This is hidden text that appears when expanded.</p>
</details>
✅ Interview Q&A
Q1: Why use <details> instead of JavaScript for toggle?
A: Because HTML5 provides built-in expand/collapse functionality without JS.
Example:
✅ Interview Q&A
Q1: Difference between <progress> and <meter>?
A:
<progress> = task completion progress (unknown/known).
👉 Next topic tum chaho to main HTML5 APIs (Canvas, SVG, Geolocation, LocalStorage,
Drag & Drop) start karun. Kya mai woh shuru karun?
You said:
Continue with suggestion topic
ChatGPT said:
Perfect 👌 ab hum HTML ke next level topic par chalte hain → HTML5 APIs.
Ye part thoda advance hai aur interview me frequently poocha jata hai.
📘 8. HTML5 APIs
8.1 Canvas (<canvas>)
Example:
<script>
let c = [Link]("myCanvas");
let ctx = [Link]("2d");
[Link] = "blue";
[Link](20, 20, 150, 50);
</script>
✅ Interview Q
Q: Difference between <canvas> and <svg>?
A:
Example:
✅ Interview Q
Q: Why SVG is better for logos?
A: Kyunki vector format hai, zoom karne par bhi quality loss nahi hota.
Example:
<script>
function getLocation() {
if ([Link]) {
[Link](showPosition);
} else {
[Link]("demo").innerHTML = "Not supported";
}
}
function showPosition(position) {
[Link]("demo").innerHTML =
"Latitude: " + [Link] +
"<br>Longitude: " + [Link];
}
</script>
✅ Interview Q
Q: Does Geolocation API need user permission?
A: Yes, browser always asks user to allow location access.
localStorage → Data permanently store hota hai (browser close hone par bhi).
Example:
<script>
[Link]("name", "Ranjeet");
alert([Link]("name"));
</script>
✅ Interview Q
Q: Difference between localStorage and cookies?
A:
Cookies → 4KB limit, client+server dono me use hote hain (HTTP requests ke saath
jaate hain).
👉 HTML5 ke through elements ko drag & drop kar sakte hain without extra JS
libraries.
Example:
<p ondrop="drop(event)" ondragover="allowDrop(event)" style="border:1px solid
black; width:200px;height:100px;"></p>
<img id="drag1" src="[Link]" draggable="true" ondragstart="drag(event)"
width="100">
<script>
function allowDrop(ev) {
[Link]();
}
function drag(ev) {
[Link]("text", [Link]);
}
function drop(ev) {
[Link]();
var data = [Link]("text");
[Link]([Link](data));
}
</script>
✅ Interview Q
Q: Can all HTML elements be draggable?
A: By default only images, links are draggable. But any element can be made
draggable using draggable="true".
✅ Summary
👉 Ab next logical step hoga HTML Accessibility + SEO best practices (alt
attributes, ARIA roles, semantic HTML ka use).
You said:
Start with below topics
8. Document Metadata
8.1 <head> element importance
8.2 <title>
8.3 Meta tags: charset, description, keywords, viewport
8.4 Favicon (<link rel="icon">)
8.5 Open Graph / Social Media tags
ChatGPT said:
📘 8. Document Metadata
8.1 <head> element importance
👉 <head> section me wo sari information hoti hai jo webpage ke content ka part nahi
hoti, lekin browser aur search engines ke liye important hoti hai.
Isme title, meta tags, favicon, stylesheets, scripts, SEO data hote hain.
Example:
<!DOCTYPE html>
<html>
<head>
<title>My First Website</title>
<meta charset="UTF-8">
<meta name="description" content="HTML Tutorial for beginners">
<link rel="stylesheet" href="[Link]">
</head>
<body>
<h1>Hello World!</h1>
</body>
</html>
✅ Interview Q:
Q: Why <head> is important?
A: Kyunki yeh browser ko document ke bare me info deta hai (metadata), SEO ke liye
zaroori hai, aur external resources (CSS, JS, fonts) load karne ke liye use hota
hai.
8.2 <title>
Example:
✅ Interview Q:
Q: Difference between <title> and <h1>?
A:
1. Charset
<meta charset="UTF-8">
2. Description
<meta name="description" content="This is a beginner HTML tutorial with examples.">
👉 Search results me website ka short summary ke roop me dikhata hai. SEO ke liye
zaroori hai.
✅ Interview Q:
Q: Why is viewport meta tag important?
A: Ye ensure karta hai ki webpage mobile devices me properly resize ho jaye
(responsive design).
Example:
✅ Interview Q:
Q: What is Favicon’s role?
A: Branding ke liye use hota hai, website easily identifiable hoti hai tabs aur
bookmarks me.
👉 Jab hum apni website link ko Facebook, Twitter, WhatsApp par share karte hain,
toh ek card (thumbnail + title + description) dikhta hai. Ye Open Graph tags ke
through hota hai.
Example:
✅ Interview Q:
Q: Why Open Graph tags are important?
A: Social media me website ka preview improve karte hain, jisse CTR (Click-Through
Rate) badhta hai.
✅ Summary
👉 Ab next logical step hoga 9. HTML Best Practices & Accessibility (SEO, ARIA
roles, alt attributes, semantic HTML ka proper use).
Kya mai tumhe next Accessibility + SEO Best Practices in HTML sikhau?
You said:
Start with below topics
9. Accessibility & Best Practices
9.1 Alt text for images
9.2 ARIA attributes (aria-label, aria-hidden)
9.3 Heading hierarchy (SEO + accessibility)
9.4 Using semantic elements properly
9.5 Clean code & indentation
ChatGPT said:
👉 Alt (alternative text) ek attribute hai jo <img> tag me use hota hai.
Jab image load nahi hoti ya screen reader (blind users) use hota hai, tab alt text
read kiya jata hai.
Example:
✅ Interview Q:
Q: Why is alt attribute important?
A: Accessibility (screen readers ke liye), SEO, aur fallback ke liye agar image
load na ho.
👉 ARIA (Accessible Rich Internet Applications) attributes help karte hain disabled
users ke liye.
1. aria-label
Screen reader ke liye custom label deta hai.
👉 Yahaan pe "X" samajhna mushkil hai, isliye aria-label screen reader ko clear text
deta hai.
2. aria-hidden
👉 Yahaan star sirf decoration hai, isliye screen readers ke liye hide kar diya.
✅ Interview Q:
Q: Difference between alt and aria-label?
A:
aria-label → kisi bhi HTML element ke liye custom accessibility label provide karta
hai.
Example:
<h1>HTML Tutorial</h1>
<h2>Introduction</h2>
<h3>What is HTML?</h3>
<h2>Basics</h2>
<h3>Headings</h3>
✅ Interview Q:
Q: Why only one <h1> tag per page?
A: Kyunki <h1> main topic represent karta hai. Multiple <h1> confuse kar sakte hain
SEO aur screen readers ko.
<div class="header"></div>
<div class="menu"></div>
<div class="content"></div>
<div class="footer"></div>
<header></header>
<nav></nav>
<main></main>
<footer></footer>
<!DOCTYPE html>
<html>
<head>
<title>Clean Code Example</title>
</head>
<body>
<header>
<h1>Welcome</h1>
</header>
<main>
<section>
<h2>About</h2>
<p>This is a clean code example.</p>
</section>
</main>
</body>
</html>
✅ Interview Q:
Q: Why is clean code important?
A: Maintainability, readability, debugging easy hota hai, aur team collaboration
better hoti hai.
🎯 Summary
Kya tum chahte ho mai ab tumhe HTML5 APIs sikhaun ek fresher + interview style me?
You said:
I am unable to understand 9.2 please explain it again in brief
ChatGPT said:
Bilkul 👍 chhota aur simple tareeke se samjhata hoon 9.2 ARIA attributes ko 👇
1. aria-label
Kisi element ko extra naam / description dene ke liye use hota hai.
Ye naam screen reader ko sunai deta hai, user ko page pe visible nahi hota.
Example:
2. aria-hidden="true"
Jab element sirf decoration ke liye ho (matlab koi meaning nahi deta), tab use
karte hain.
Example:
👆 Yahaan star icon sirf design ke liye hai. Screen reader usko ignore karega.
👉 Ab tumhe clear hua ya mai tumhare liye ek real-world example page banaun jisme
aria-label aur aria-hidden dono use kiye ho?
You said:
Start with below topics
10. Advanced HTML Features
10.1 Data attributes (data-*)
10.2 Custom attributes
10.3 Deprecated elements (like <marquee>, <center>)
10.4 HTML Entities ( , ©, etc.)
10.5 Local Storage & Web Storage (Intro – works with JS)
ChatGPT said:
Perfect! Ab hum 10. Advanced HTML Features ko step by step fresher + interview
style me samjhenge. Hinglish me explain karunga.
👉 Data attributes HTML me custom information store karne ke liye use hote hain.
Example:
JS me access:
✅ Interview Q:
Q: What are data attributes used for?
A: To store extra custom info in HTML which can be accessed by JS without affecting
the UI.
HTML me custom attributes create kiye ja sakte hain, but validity ke liye data-*
preferred hai.
Agar <button myinfo="hello"> likho, browser chalega but validator warning dega.
Interview Tip:
Why Deprecated?
Example:
✅ Interview Q:
Q: Name 2 deprecated HTML elements.
A: <marquee>, <center>
HTML entities special characters ko show karte hain jo normally browser me render
nahi hote.
Format: &entity;
Common Entities:
Entity Symbol
Non-breaking space
© ©
® ®
< <
> >
& &
Example:
✅ Interview Q:
Q: Why we use HTML entities?
A: To display reserved or special characters correctly in HTML.
10.5 Local Storage & Web Storage (Intro – works with JS)
Web Storage browser me client side data store karne ka simple way hai.
Two types:
LocalStorage → Data permanent (browser close hone ke baad bhi save rahega)
SessionStorage → Data temporary (tab close hone par delete ho jata hai)
Example: LocalStorage
// Set item
[Link]('username', 'Ranjeet');
// Get item
[Link]([Link]('username')); // Ranjeet
// Remove item
[Link]('username');
Example: SessionStorage
[Link]('sessionName', 'Test');
[Link]([Link]('sessionName'));
✅ Interview Q:
Q: Difference between LocalStorage and SessionStorage?
A: LocalStorage → permanent, SessionStorage → temporary (tab close hone par
delete).
Agar chaho, mai next topic HTML5 APIs (Geolocation, Drag & Drop, Canvas, etc.)
start kar doon fresher + interview style me.
You said:
Mujhe 10.1, 10.2 dono samajh nahi aaye detail mai explain karo
ChatGPT said:
Bilkul Ranjeet! 😄 Chalo 10.1 Data Attributes aur 10.2 Custom Attributes ko bilkul
detail me samajhte hain, step by step, fresher level se.
Data attributes HTML me extra information store karne ka safe tareeka hai.
Ye browser ko ignore karta hai (matlab UI me directly dikhai nahi deta), JavaScript
use kar sakta hai.
Format: data-* → * ki jagah koi bhi naam jaise data-id, data-role, data-info
🔹 Syntax:
<tag data-key="value">Content</tag>
Example:
🔹 JavaScript me Access:
const btn = [Link]('button');
<div data-user-id="500"></div>
[Link]('div').[Link]; // 500
✅ Interview Tip:
data-* attributes HTML me extra info store karne ke liye use hote hain, specially
JS ke liye.
Custom attributes ka matlab hai HTML element me apna khud ka attribute banana.
Example:
🔹 Best Practice:
🔹 Interview Q Examples:
Agar chaho, mai ek real-world example bana ke dikhau jisme data-* aur JS dono use
ho, taaki practically tum samajh jao.
You said:
Start with below topics
11. Mini Projects
11.1 Resume Page (only HTML)
11.2 Product Catalog Page
11.3 Registration Form
11.4 Blog Page Layout
11.5 Portfolio Skeleton
ChatGPT said:
Perfect Ranjeet! 😎 Ab hum 11. Mini Projects start karte hain. Ye projects fresher
level ke liye simple hai aur interview me practical knowledge dikhane ke liye kaam
aate hain. Main HTML only examples aur structure samjhaunga, CSS/JS later add kar
sakte ho.
Example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Ranjeet Singh Resume</title>
</head>
<body>
<header>
<h1>Ranjeet Singh</h1>
<p>Frontend Developer</p>
</header>
<section>
<h2>Contact</h2>
<p>Email: ranjeet@[Link]</p>
<p>Phone: 9548378123</p>
<p>Address: Agra, India</p>
</section>
<section>
<h2>Education</h2>
<ul>
<li>[Link]. Computer Science - XYZ College</li>
<li>High School - ABC School</li>
</ul>
</section>
<section>
<h2>Skills</h2>
<ul>
<li>HTML, CSS, JavaScript</li>
<li>React JS (Basics)</li>
</ul>
</section>
<section>
<h2>Experience</h2>
<p>Intern at XYZ Company (June 2025 - Aug 2025)</p>
</section>
</body>
</html>
✅ Interview Q:
Example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Product Catalog</title>
</head>
<body>
<header>
<h1>My Products</h1>
</header>
<section>
<h2>Electronics</h2>
<ul>
<li>
<h3>Smartphone</h3>
<img src="[Link]" alt="Smartphone" width="150">
<p>Price: ₹15000</p>
</li>
<li>
<h3>Laptop</h3>
<img src="[Link]" alt="Laptop" width="150">
<p>Price: ₹45000</p>
</li>
</ul>
</section>
</body>
</html>
✅ Interview Q:
Example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Registration Form</title>
</head>
<body>
<h1>Registration Form</h1>
<form action="/submit" method="POST">
<label for="name">Name:</label>
<input type="text" id="name" name="name" required><br><br>
<label for="email">Email:</label>
<input type="email" id="email" name="email" required><br><br>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required><br><br>
<label>Gender:</label>
<input type="radio" name="gender" value="male"> Male
<input type="radio" name="gender" value="female"> Female<br><br>
<label for="hobbies">Hobbies:</label>
<input type="checkbox" name="hobbies" value="Reading"> Reading
<input type="checkbox" name="hobbies" value="Sports"> Sports<br><br>
<button type="submit">Register</button>
</form>
</body>
</html>
✅ Interview Q:
Example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My Blog</title>
</head>
<body>
<header>
<h1>Ranjeet's Blog</h1>
</header>
<main>
<article>
<h2>Learning HTML Basics</h2>
<p>By Ranjeet Singh | Aug 2025</p>
<p>This is my first blog post about HTML.</p>
</article>
<aside>
<h3>Categories</h3>
<ul>
<li>HTML</li>
<li>CSS</li>
<li>JavaScript</li>
</ul>
</aside>
</main>
</body>
</html>
✅ Interview Q:
About Me → Paragraph
Example:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Portfolio</title>
</head>
<body>
<header>
<h1>Ranjeet Singh</h1>
<p>Frontend Developer</p>
</header>
<section>
<h2>About Me</h2>
<p>I am a fresher web developer learning HTML, CSS, and JS.</p>
</section>
<section>
<h2>Projects</h2>
<ul>
<li>Resume Page (HTML)</li>
<li>Product Catalog Page</li>
<li>Registration Form</li>
</ul>
</section>
<section>
<h2>Contact</h2>
<p>Email: ranjeet@[Link]</p>
</section>
</body>
</html>
✅ Interview Q: