Join GyanXp WhatsApp Channel! - Join Now
Complete set of 30 Practical Exam Solutions with Live Output, Practice Timers, and Progress Tracking!
<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: Arial, sans-serif; padding: 15px; }
.form-group { margin-bottom: 12px; }
label { display: block; font-weight: bold; margin-bottom: 4px; }
input, textarea { width: 100%; padding: 8px; box-sizing: border-box; }
button { background: #ff6600; color: #fff; border: none; padding: 8px 16px; cursor: pointer; border-radius: 4px; }
</style>
</head>
<body>
<h3>Contact Form</h3>
<form>
<div class="form-group">
<label>Name:</label>
<input type="text" id="name" autofocus placeholder="Enter Name">
</div>
<div class="form-group">
<label>Mobile No:</label>
<input type="tel" placeholder="Enter Mobile No">
</div>
<div class="form-group">
<label>Email ID:</label>
<input type="email" placeholder="Enter Email">
</div>
<div class="form-group">
<label>Comments:</label>
<textarea rows="3" placeholder="Enter Comments"></textarea>
</div>
<button type="submit">Submit</button>
</form>
</body>
</html>
autofocus attribute automatically focuses the cursor on the Name input field when the page loads.<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: Arial, sans-serif; padding: 15px; }
.form-group { margin-bottom: 12px; }
label { display: block; font-weight: bold; margin-bottom: 4px; }
input, textarea { width: 100%; padding: 8px; box-sizing: border-box; }
button { background: #ff6600; color: #fff; border: none; padding: 8px 16px; cursor: pointer; border-radius: 4px; }
</style>
</head>
<body>
<h3>Contact Form with Validation</h3>
<form>
<div class="form-group">
<label>Name:</label>
<input type="text" autofocus required placeholder="Enter Name">
</div>
<div class="form-group">
<label>Mobile No:</label>
<input type="tel" required pattern="[0-9]{10}" placeholder="10 digit mobile number">
</div>
<div class="form-group">
<label>Email ID:</label>
<input type="email" required placeholder="Enter Email">
</div>
<div class="form-group">
<label>Comments:</label>
<textarea rows="3" placeholder="Enter Comments"></textarea>
</div>
<button type="submit">Submit</button>
</form>
</body>
</html>
required and regex pattern pattern="[0-9]{10}".<!DOCTYPE html>
<html>
<head>
<style>
.circle {
width: 200px;
height: 200px;
background-color: red;
border: 2px double black;
border-radius: 50%;
transition: background-color 0.3s ease;
}
.circle:hover {
background-color: yellow;
}
</style>
</head>
<body>
<h3>Hover Circle Demo</h3>
<div class="circle"></div>
</body>
</html>
border-radius: 50% converts a square div into a circle, while :hover toggles color on mouse hover.<!DOCTYPE html>
<html>
<body>
<h3>Hyperlink Example</h3>
<p>Click the link below to go to Google:</p>
<a href="https://www.google.com" target="_blank">Visit Google</a>
</body>
</html>
href attribute defines the target URL, and target="_blank" opens the link in a new tab.<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: Arial, sans-serif; padding: 15px; }
input { width: 100px; padding: 5px; margin-right: 10px; }
button { padding: 6px 12px; margin-right: 5px; cursor: pointer; }
#result { margin-top: 15px; font-weight: bold; font-size: 16px; color: #ff6600; }
</style>
</head>
<body>
<h3>Arithmetic Calculator</h3>
<input type="number" id="num1" placeholder="Num 1">
<input type="number" id="num2" placeholder="Num 2"><br><br>
<button onclick="calc('+')">Add</button>
<button onclick="calc('-')">Subtract</button>
<button onclick="calc('*')">Multiply</button>
<button onclick="calc('/')">Divide</button>
<div id="result"></div>
<script>
function calc(op) {
let n1 = parseFloat(document.getElementById('num1').value);
let n2 = parseFloat(document.getElementById('num2').value);
let res = 0;
if (isNaN(n1) || isNaN(n2)) {
document.getElementById('result').innerText = "Please enter valid numbers!";
return;
}
if (op === '+') res = n1 + n2;
else if (op === '-') res = n1 - n2;
else if (op === '*') res = n1 * n2;
else if (op === '/') res = n2 !== 0 ? (n1 / n2) : "Cannot divide by 0";
document.getElementById('result').innerText = "Result: " + res;
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<h3>Clickable Image Example</h3>
<p>Click the image below to visit GyanXP:</p>
<a href="https://www.gyanxp.com" target="_blank">
<img src="https://via.placeholder.com/200x100?text=Click+Me" alt="Clickable Banner" style="border:2px solid #ff6600; border-radius:8px;">
</a>
</body>
</html>
<img> tag inside an <a> anchor tag turns the image into a clickable link.<!DOCTYPE html>
<html>
<head>
<style>
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { border: 1px solid #ddd; padding: 8px; }
th { background-color: #ff6600; color: white; }
tr:nth-child(even) { background-color: #f2f2f2; }
</style>
</head>
<body>
<h3>Student Academic Report Table</h3>
<table>
<tr>
<th>Roll No</th>
<th>Student Name</th>
<th>Course</th>
<th>Marks</th>
</tr>
<tr><td>101</td><td>Rahul Sharma</td><td>O Level</td><td>85%</td></tr>
<tr><td>102</td><td>Priya Verma</td><td>A Level</td><td>90%</td></tr>
<tr><td>103</td><td>Amit Patel</td><td>O Level</td><td>78%</td></tr>
<tr><td>104</td><td>Neha Singh</td><td>CCC</td><td>92%</td></tr>
</table>
</body>
</html>
<table>, <tr>, <th>, and <td> tags to construct 1 header row + 4 data rows (5 rows total across 4 columns).<!DOCTYPE html>
<html>
<head>
<style>
table { width: 300px; border-collapse: collapse; text-align: center; }
th, td { border: 1px solid #333; padding: 6px; }
th { background-color: #ff6600; color: #fff; }
</style>
</head>
<body>
<h3>Squares and Cubes (0 to 10)</h3>
<div id="table-container"></div>
<script>
let html = "<table><tr><th>Number</th><th>Square</th><th>Cube</th></tr>";
for (let i = 0; i <= 10; i++) {
html += `<tr><td>${i}</td><td>${i * i}</td><td>${i * i * i}</td></tr>`;
}
html += "</table>";
document.getElementById('table-container').innerHTML = html;
</script>
</body>
</html>
for loop iterates from 0 to 10, computing i*i and i*i*i and dynamically constructing the table markup.<!DOCTYPE html>
<html>
<head>
<style>
table {
width: 80%;
height: 150px;
border: 4px double #ff6600;
border-spacing: 5px; /* Cell spacing equivalent */
background-color: #fff8f0;
margin: auto;
}
td, th {
border: 1px solid #333;
padding: 5px; /* Cell padding equivalent */
text-align: center;
}
th { background-color: #ffe0cc; }
</style>
</head>
<body>
<h3 style="text-align:center;">Custom Styled Table</h3>
<table>
<tr>
<th>Item Code</th>
<th>Item Name</th>
<th>Price</th>
</tr>
<tr>
<td>P001</td>
<td>Web Designing Book</td>
<td>₹350</td>
</tr>
<tr>
<td>P002</td>
<td>Python Module Kit</td>
<td>₹450</td>
</tr>
</table>
</body>
</html>
border: 4px double #ff6600, border-spacing: 5px, and padding: 5px to achieve exact legacy formatting cleanly.<!DOCTYPE html>
<html>
<head>
<style>
body { background-color: #f0f4f8; font-family: Arial; padding: 15px; }
ol { color: red; }
ul { color: blue; }
dl { color: green; }
</style>
</head>
<body>
<h3>Indian States List Demonstration</h3>
<h4>1. Ordered List (Numbered A, B, C...)</h4>
<ol type="A" start="1">
<li>Uttar Pradesh</li>
<li>Maharashtra</li>
<li>Rajasthan</li>
<li>Madhya Pradesh</li>
</ol>
<h4>2. Unordered List (Square Bullets)</h4>
<ul type="square">
<li>Uttar Pradesh</li>
<li>Maharashtra</li>
<li>Rajasthan</li>
<li>Madhya Pradesh</li>
</ul>
<h4>3. Definition List</h4>
<dl>
<dt><b>Uttar Pradesh</b></dt>
<dd>Capital: Lucknow</dd>
<dt><b>Maharashtra</b></dt>
<dd>Capital: Mumbai</dd>
</dl>
</body>
</html>
<ol> with type="A", <ul> with type="square", and <dl> definition pairs, each styled in distinct colors.<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: Arial; padding: 15px; }
.form-container { width: 350px; margin: auto; border: 1px solid #ccc; padding: 15px; border-radius: 8px; }
h2 { text-align: center; color: #ff6600; }
.row { margin-bottom: 10px; }
label { font-weight: bold; display: block; }
input[type="text"], input[type="number"], textarea { width: 100%; padding: 6px; box-sizing: border-box; }
.radio-group { display: flex; gap: 10px; margin-top: 5px; }
button { width: 100%; background: #ff6600; color: white; border: none; padding: 8px; cursor: pointer; }
</style>
</head>
<body>
<div class="form-container">
<h2>Swimming Membership Form</h2>
<form>
<div class="row"><label>Name:</label><input type="text" required></div>
<div class="row"><label>Address:</label><textarea rows="2" required></textarea></div>
<div class="row"><label>Contact Number:</label><input type="text" required></div>
<div class="row"><label>Age (10-18):</label><input type="number" min="10" max="18" required></div>
<div class="row">
<label>Membership Duration:</label>
<div class="radio-group">
<label><input type="radio" name="dur" value="1" required> 1 Month</label>
<label><input type="radio" name="dur" value="2"> 2 Months</label>
<label><input type="radio" name="dur" value="3"> 3 Months</label>
</div>
</div>
<button type="submit">Join Membership</button>
</form>
</div>
</body>
</html>
min="10" max="18" on numeric inputs for constraint validation and radio buttons grouped by name="dur".<!DOCTYPE html>
<html>
<head>
<style>
body { background-color: #e3f2fd; font-family: Arial, sans-serif; padding: 20px; }
h1 { text-align: center; color: #0d47a1; }
p { font-size: 16px; line-height: 1.8; color: #333; text-align: justify; }
</style>
</head>
<body>
<h1>Introduction to Web Designing</h1>
<p>
Web Designing is an exciting field that combines creativity and technical skills to build websites.<br>
It involves learning HTML for structure, CSS for styling, and JavaScript for interactive features.<br>
Mastering these core technologies empowers students to create modern responsive web applications.
</p>
</body>
</html>
text-align: center on H1 and line break tags <br> to separate the paragraph into 3 distinct lines.<!DOCTYPE html>
<html>
<head>
<style>
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid #000; padding: 8px; text-align: center; }
th { background-color: #ff6600; color: #fff; }
</style>
</head>
<body>
<h3>Student Academic Records</h3>
<table>
<tr>
<th>Sr No</th>
<th>Name</th>
<th>Class</th>
<th>Year of Passing</th>
<th>Percentage</th>
</tr>
<tr><td>1</td><td>Aman Gupta</td><td>O Level</td><td>2024</td><td>82%</td></tr>
<tr><td>2</td><td>Suman Singh</td><td>A Level</td><td>2025</td><td>88%</td></tr>
<tr><td>3</td><td>Rohan Mehta</td><td>CCC</td><td>2024</td><td>76%</td></tr>
</table>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: Arial; padding: 15px; }
.form-card { width: 320px; border: 1px solid #ddd; padding: 15px; border-radius: 6px; }
.field { margin-bottom: 10px; }
label { display: block; font-weight: bold; }
input, select { width: 100%; padding: 6px; margin-top: 4px; box-sizing: border-box; }
button { background: #ff6600; color: #fff; border: none; padding: 8px 15px; cursor: pointer; width: 100%; margin-top: 10px; }
</style>
</head>
<body>
<div class="form-card">
<h3 style="text-align:center; margin-top:0;">Library Management</h3>
<form>
<div class="field"><label>Name:</label><input type="text" required></div>
<div class="field"><label>Father's Name:</label><input type="text" required></div>
<div class="field"><label>Email ID:</label><input type="email" required></div>
<div class="field">
<label>Academic Year:</label>
<select>
<option>1st Year</option>
<option>2nd Year</option>
<option>3rd Year</option>
</select>
</div>
<button type="submit">Submit Request</button>
</form>
</div>
</body>
</html>
<select> and <option> elements to create a clean drop-down menu selection for academic years.<!DOCTYPE html>
<html>
<head>
<style>
body { display: flex; height: 280px; margin: 0; font-family: Arial; }
.left-pane { width: 40%; background: #f4f4f4; padding: 10px; border-right: 2px solid #ccc; }
.right-pane { width: 60%; padding: 10px; }
a { display: block; margin-bottom: 8px; color: #ff6600; text-decoration: none; font-weight: bold; }
</style>
</head>
<body>
<div class="left-pane">
<h4>National Leaders</h4>
<a href="javascript:void(0)" onclick="showLeader('Mahatma Gandhi', 'Father of the Nation, leader of Indian Independence Movement through non-violence.')">Mahatma Gandhi</a>
<a href="javascript:void(0)" onclick="showLeader('Netaji Subhash Chandra Bose', 'Founder of Azad Hind Fauj (INA), key figure in armed struggle for independence.')">Subhash Chandra Bose</a>
</div>
<div class="right-pane" id="details-pane">
<h4>Leader Details</h4>
<p>Click a leader name on the left to view details.</p>
</div>
<script>
function showLeader(name, desc) {
document.getElementById('details-pane').innerHTML = `<h3 style="color:#ff6600;">${name}</h3><p>${desc}</p>`;
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
.biodata-box { width: 300px; border: 2px solid #ff6600; padding: 15px; border-radius: 8px; font-family: Arial; }
h2 { text-align: center; color: #ff6600; border-bottom: 1px solid #ddd; padding-bottom: 5px; }
p { font-size: 14px; margin: 8px 0; }
</style>
</head>
<body>
<div class="biodata-box">
<h2>BIO-DATA</h2>
<p><b>Name:</b> Rajesh Kumar</p>
<p><b>Father's Name:</b> Shri Suresh Kumar</p>
<p><b>Date of Birth:</b> 15/08/2002</p>
<p><b>Age:</b> 22 Years</p>
</div>
</body>
</html>
<h2>, <p>, and <b> for organized data presentation.<!DOCTYPE html>
<html>
<body style="font-family: Arial; padding: 15px;">
<h3>(a) Favourite Books (Ordered List)</h3>
<ol>
<li>Wings of Fire</li>
<li>The Alchemist</li>
<li>Atomic Habits</li>
</ol>
<h3>(b) Hobbies (Unordered List)</h3>
<ul>
<li>Web Coding</li>
<li>Reading Tech Blogs</li>
<li>Playing Chess</li>
</ul>
<h3>(c) HTML Tags Glossary (Definition List)</h3>
<dl>
<dt><b><h1></b></dt>
<dd>Defines the most important top-level heading.</dd>
<dt><b><p></b></dt>
<dd>Defines a paragraph block of text.</dd>
</dl>
</body>
</html>
<ol>, <ul>, and <dl>.<!DOCTYPE html>
<html>
<head>
<style>
table { width: 100%; border-collapse: collapse; text-align: center; }
th, td { border: 1px solid #333; padding: 8px; }
th { background-color: #ff6600; color: white; }
</style>
</head>
<body>
<h3>Employee Department Matrix</h3>
<table>
<tr>
<th colspan="3">GyanXP Employee Directory</th>
</tr>
<tr>
<th>Department</th>
<th>Emp ID</th>
<th>Emp Name</th>
</tr>
<tr>
<td rowspan="2"><b>IT Dept</b></td>
<td>E101</td>
<td>Aarav Sharma</td>
</tr>
<tr>
<td>E102</td>
<td>Kavya Verma</td>
</tr>
<tr>
<td><b>HR Dept</b></td>
<td>E103</td>
<td>Rohan Das</td>
</tr>
</table>
</body>
</html>
colspan="3" to span the main title across columns and rowspan="2" to merge IT department cells.<!DOCTYPE html>
<html>
<body style="font-family: Arial; padding: 15px;">
<h1 style="color:#ff6600;">Welcome to My Webpage</h1>
<p>
Hello! I am a student preparing for the <b>NIELIT O Level Course</b>.
I enjoy <i>developing clean interactive web user interfaces</i>.
</p>
<p>
My goal is to achieve <u>top marks in Web Designing & Publishing (M2-R5)</u> by practicing daily live coding practicals.
</p>
</body>
</html>
<b> for bold, <i> for italic, and <u> for underline.<!DOCTYPE html>
<html>
<head>
<style>
.welcome-text {
text-align: center;
font-size: 48px;
font-weight: bold;
text-decoration: underline;
color: #1f2421;
transition: color 0.3s ease;
cursor: pointer;
margin-top: 50px;
}
.welcome-text:hover {
color: #ff6600;
}
</style>
</head>
<body>
<div class="welcome-text">Welcome</div>
</body>
</html>
:hover pseudo-class to smooth-transition text color.<!DOCTYPE html>
<html>
<head>
<style>
.layout-table { width: 100%; border-collapse: collapse; font-family: Arial; }
.header-cell { background: #ff6600; color: white; padding: 15px; text-align: center; }
.nav-cell { width: 25%; background: #f8f9fa; padding: 10px; vertical-align: top; border-right: 1px solid #ccc; }
.content-cell { padding: 15px; vertical-align: top; }
.footer-cell { background: #1f2421; color: white; text-align: center; padding: 8px; font-size: 12px; }
</style>
</head>
<body>
<table class="layout-table" border="1">
<tr><td colspan="2" class="header-cell"><h2 style="margin:0;">Government Polytechnic Infrastructure</h2></td></tr>
<tr>
<td class="nav-cell">
<b>Facilities</b><br><br>
• Computer Labs<br>
• Central Library<br>
• Sports Complex<br>
• Auditorium
</td>
<td class="content-cell">
<h3>State-of-the-Art Computer Labs</h3>
<p>Our campus features high-speed internet-enabled modern labs with over 200 high-performance workstations for IT students.</p>
</td>
</tr>
<tr><td colspan="2" class="footer-cell">© 2026 College Campus Portal</td></tr>
</table>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
table { width: 100%; border-collapse: collapse; font-family: Arial; }
td, th { border: 1px solid #333; padding: 10px; vertical-align: top; }
.header { background-color: orange; color: white; text-align: center; font-weight: bold; font-size: 20px; }
.sub-table { width: 100%; border-collapse: collapse; }
.sub-table td { border: 1px solid #ccc; padding: 4px; }
</style>
</head>
<body>
<table>
<tr>
<td colspan="3" class="header">Header: Student Profile</td>
</tr>
<tr>
<td width="33%">
<h4 style="margin-top:0;">Personal Details</h4>
<p><b>Name:</b> Vikram Malhotra</p>
<p><b>Age:</b> 20</p>
<p><b>Address:</b> Lucknow, UP</p>
</td>
<td width="33%">
<h4 style="margin-top:0;">Academic Information</h4>
<table class="sub-table">
<tr><th>Subject</th><th>Grade</th></tr>
<tr><td>M2-R5</td><td>S Grade</td></tr>
<tr><td>M1-R5</td><td>A Grade</td></tr>
</table>
</td>
<td width="33%">
<h4 style="margin-top:0;">Hobbies</h4>
<ul style="padding-left:18px;">
<li>Web Coding</li>
<li>Playing Chess</li>
<li>Blogging</li>
</ul>
</td>
</tr>
</table>
</body>
</html>
colspan="3" top header span and nested table formatting.<!DOCTYPE html>
<html>
<head>
<style>
.form-wrapper { width: 340px; margin: 10px auto; border: 2px solid #ff6600; padding: 15px; border-radius: 8px; font-family: Arial; }
.form-title { text-align: center; color: #ff6600; text-transform: uppercase; font-size: 18px; margin-bottom: 15px; }
.input-group { margin-bottom: 10px; }
label { font-size: 13px; font-weight: bold; display: block; margin-bottom: 3px; }
input[type="text"], input[type="number"], textarea { width: 100%; padding: 6px; box-sizing: border-box; }
button { background: #ff6600; color: #fff; border: none; padding: 8px; width: 100%; cursor: pointer; }
</style>
</head>
<body>
<div class="form-wrapper">
<div class="form-title">Swimming Membership Form</div>
<form>
<div class="input-group"><label>Member Name:</label><input type="text" required></div>
<div class="input-group"><label>Address:</label><textarea rows="2" required></textarea></div>
<div class="input-group"><label>Contact Number:</label><input type="text" required></div>
<div class="input-group"><label>Age (10 - 18):</label><input type="number" min="10" max="18" required></div>
<button type="submit">Submit Application</button>
</form>
</div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: Arial; padding: 15px; }
.input-box { margin-bottom: 8px; }
button { background: #ff6600; color: #fff; border: none; padding: 6px 12px; cursor: pointer; }
#out { margin-top: 10px; font-weight: bold; color: #ff6600; }
</style>
</head>
<body>
<h3>Simple Interest Calculator</h3>
<div class="input-box">Principal (₹): <input type="number" id="p"></div>
<div class="input-box">Time (Years): <input type="number" id="t"></div>
<button onclick="calcInterest()">Calculate Interest</button>
<div id="out"></div>
<script>
function calcInterest() {
let p = parseFloat(document.getElementById('p').value);
let t = parseFloat(document.getElementById('t').value);
if(isNaN(p) || isNaN(t)) return;
let r = (p > 100000) ? 15 : 10;
let si = (p * r * t) / 100;
document.getElementById('out').innerHTML = `Rate Applied: ${r}% <br>Simple Interest: ₹${si.toFixed(2)}`;
}
</script>
</body>
</html>
(p > 100000) ? 15 : 10 to dynamically assign interest rate.<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: Arial; padding: 15px; }
.input-row { margin-bottom: 6px; }
button { background: #ff6600; color: #fff; border: none; padding: 6px 12px; cursor: pointer; }
#report { margin-top: 12px; line-height: 1.6; }
</style>
</head>
<body>
<h3>Student Grade Report Calculator</h3>
<div class="input-row">Subject 1: <input type="number" id="m1"></div>
<div class="input-row">Subject 2: <input type="number" id="m2"></div>
<div class="input-row">Subject 3: <input type="number" id="m3"></div>
<button onclick="calcResult()">Calculate Grade</button>
<div id="report"></div>
<script>
function calcResult() {
let m1 = parseFloat(document.getElementById('m1').value) || 0;
let m2 = parseFloat(document.getElementById('m2').value) || 0;
let m3 = parseFloat(document.getElementById('m3').value) || 0;
let total = m1 + m2 + m3;
let avg = total / 3;
let result = (m1 >= 33 && m2 >= 33 && m3 >= 33) ? "PASS" : "FAIL";
let grade = "F";
if (result === "PASS") {
if (avg >= 85) grade = "S";
else if (avg >= 75) grade = "A";
else if (avg >= 65) grade = "B";
else if (avg >= 55) grade = "C";
else grade = "D";
}
document.getElementById('report').innerHTML = `
<b>Total Marks:</b> ${total}/300 <br>
<b>Average:</b> ${avg.toFixed(2)}% <br>
<b>Result:</b> <span style="color:${result==='PASS'?'green':'red'};">${result}</span> <br>
<b>Grade:</b> ${grade}
`;
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>about my college</title>
<style>
body {
background-color: #f0f4f8;
font-family: Arial, sans-serif;
padding: 15px;
}
.college-header { text-align: center; }
.college-name { font-size: 28px; font-weight: bold; color: #ff6600; margin: 0; }
.address { font-size: 12px; color: #666; margin-top: 4px; }
.c1 { color: #d9534f; font-family: 'Georgia', serif; }
.c2 { color: #0275d8; font-family: 'Courier New', monospace; }
.c3 { color: #5cb85c; font-family: 'Verdana', sans-serif; }
</style>
</head>
<body>
<div class="college-header">
<div class="college-name">NATIONAL INSTITUTE OF TECHNOLOGY</div>
<div class="address">123 Knowledge Park, City Campus, Pin - 226001</div>
</div>
<hr>
<marquee bgcolor="#ff6600" style="color:#fff; padding:5px; font-weight:bold;">Admissions Open for 2026 Academic Session! Apply Online Today.</marquee>
<h3>Offered Courses:</h3>
<ul>
<li class="c1">NIELIT O Level (Web Designing & Publishing)</li>
<li class="c2">Diploma in Computer Science</li>
<li class="c3">Bachelor of Computer Applications (BCA)</li>
</ul>
</body>
</html>
<marquee> for scrolling text along with distinct font typography rules for each listed course.<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: Arial; padding: 15px; }
.box { background: #f8f9fa; border: 1px solid #ddd; padding: 10px; margin-bottom: 10px; border-radius: 6px; word-break: break-word; }
h4 { margin: 0 0 5px 0; color: #ff6600; }
</style>
</head>
<body>
<h3>Numbers Classifier (0 - 100)</h3>
<div class="box"><h4>Even Numbers:</h4><div id="evens"></div></div>
<div class="box"><h4>Odd Numbers:</h4><div id="odds"></div></div>
<div class="box"><h4>Prime Numbers:</h4><div id="primes"></div></div>
<script>
let evens = [], odds = [], primes = [];
function isPrime(num) {
if (num < 2) return false;
for (let i = 2; i <= Math.sqrt(num); i++) {
if (num % i === 0) return false;
}
return true;
}
for (let i = 0; i <= 100; i++) {
if (i % 2 === 0) evens.push(i);
else odds.push(i);
if (isPrime(i)) primes.push(i);
}
document.getElementById('evens').innerText = evens.join(', ');
document.getElementById('odds').innerText = odds.join(', ');
document.getElementById('primes').innerText = primes.join(', ');
</script>
</body>
</html>
i % 2 for parity and trial division up to Math.sqrt(num) for prime check.<!DOCTYPE html>
<html>
<head>
<style>
.frame-wrapper { display: flex; gap: 15px; font-family: Arial; }
.nav-box { width: 30%; background: #f0f0f0; padding: 10px; border-radius: 6px; }
.display-box { width: 70%; border: 2px solid #ff6600; padding: 10px; border-radius: 6px; }
a { display: block; margin-bottom: 8px; color: #ff6600; font-weight: bold; }
</style>
</head>
<body>
<h3>Target Attribute Demonstration</h3>
<div class="frame-wrapper">
<div class="nav-box">
<a href="https://www.wikipedia.org" target="myTargetFrame">Load Wikipedia</a>
<a href="https://www.bing.com" target="myTargetFrame">Load Bing Search</a>
</div>
<div class="display-box">
<iframe name="myTargetFrame" style="width:100%; height:200px; border:none;" srcdoc="<h4 style='color:#666;'>Click a link on the left to target this frame.</h4>"></iframe>
</div>
</div>
</body>
</html>
target="myTargetFrame" on links directs navigation output straight inside the named iframe.<!DOCTYPE html>
<html>
<head>
<style>
.image-container { display: flex; justify-content: space-between; align-items: center; padding: 10px; }
.img-box { text-align: center; font-family: Arial; font-size: 12px; font-weight: bold; }
img { border: 2px solid #333; border-radius: 6px; }
</style>
</head>
<body>
<h3 style="text-align:center;">Image Alignment (Left, Center, Right)</h3>
<div class="image-container">
<div class="img-box">
<img src="https://via.placeholder.com/100/ff6600/ffffff?text=Left" alt="Left">
<div>LEFT</div>
</div>
<div class="img-box">
<img src="https://via.placeholder.com/100/007bff/ffffff?text=Center" alt="Center">
<div>CENTER</div>
</div>
<div class="img-box">
<img src="https://via.placeholder.com/100/28a745/ffffff?text=Right" alt="Right">
<div>RIGHT</div>
</div>
</div>
</body>
</html>
justify-content: space-between in Flexbox to position three images cleanly at Left, Center, and Right.<!DOCTYPE html>
<html>
<head>
<style>
body { font-family: Arial, sans-serif; padding: 15px; }
.reg-form { width: 320px; border: 1px solid #ccc; padding: 15px; border-radius: 8px; margin: auto; }
.form-group { margin-bottom: 12px; }
label { display: block; font-weight: bold; margin-bottom: 4px; }
input[type="text"], input[type="email"] { width: 100%; padding: 8px; box-sizing: border-box; }
button { background: #ff6600; color: #fff; border: none; padding: 8px 16px; width: 100%; cursor: pointer; border-radius: 4px; }
</style>
</head>
<body>
<div class="reg-form">
<h3 style="text-align:center; color:#ff6600;">Student Registration</h3>
<form onsubmit="return validateForm()">
<div class="form-group">
<label>Full Name:</label>
<input type="text" id="fullname" placeholder="Enter full name">
</div>
<div class="form-group">
<label>Email Address:</label>
<input type="email" id="email" placeholder="Enter email address">
</div>
<button type="submit">Register Now</button>
</form>
</div>
<script>
function validateForm() {
let name = document.getElementById('fullname').value;
let email = document.getElementById('email').value;
if (name.trim() === "" || email.trim() === "") {
alert("Validation Error: Please fill in all required fields!");
return false;
}
alert("Registration Successful!");
return true;
}
</script>
</body>
</html>
onsubmit="return validateForm()", ensuring fields are verified before submission.Not registered yet? Sign up
By login, you agree to our Privacy & Policy & Disclaimer