Web Assignment 5
Web Assignment 5
DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link href="https://cdnjs.cloudflare.com/ajax/libs/fontawesome/6.0.0/css/all.min.css"
rel="stylesheet">
<style>
*{
margin: 0;
padding: 0; box-sizing:
border-box;
body {
'Georgia', serif;
}
h1 { font-size: 2.5em; }
h2 { font-size: 2em; } h3
{ font-size: 1.5em; }
/* Paragraph Styles */
p{
margin-bottom: 15px;
#444;
/* List Styles */
.fancy-list { list-
style: none;
padding-left: 20px;
.fancy-list li {
margin: 10px 0;
padding-left: 25px;
position: relative;
.fancy-list li::before {
absolute; left: 0;
color: #3498db;
}
counter-reset: custom-counter;
.custom-ordered li { counter-
position: relative;
.custom-ordered li::before {
content: counter(custom-counter);
/* Hoverable Table */
border-collapse: collapse;
margin: 20px 0;
}
.hover-table th {
background: #3498db;
text-align: left;
.hover-table td { padding:
#ddd;
.hover-table tr:nth-child(even) {
background: #f9f9f9;
.horizontal-nav {
background: #2c3e50;
bottom: 20px;
}
.horizontal-nav ul {
flex; justify-content:
.horizontal-nav li {
.horizontal-nav a { color:
white; text-decoration:
border-radius: 3px;
.horizontal-nav a:hover {
background: #3498db;
.vertical-nav { width:
200px; background:
#2c3e50; padding:
height: 100%;
.vertical-nav ul {
list-style: none;
.vertical-nav li {
margin: 10px 0;
.vertical-nav a {
decoration: none;
block;
.vertical-nav a:hover {
background: #3498db;
/* 2-Column Layout */
.container { max-
width: 1200px;
margin: 0 auto;
padding: 20px;
/* Calculator */ .calculator {
10px rgba(0,0,0,0.1); }
.calculator input {
border-radius: 5px;
.calculator button {
background: #3498db;
cursor: pointer;
.calculator button:hover {
background: #2980b9;
/* Responsive Design */
.vertical-nav {
width: 100%;
height: auto;
position: static;
.horizontal-nav ul { flex-
center;
.horizontal-nav li {
margin: 5px 0;
}
}
</style>
</head>
<body>
<nav class="horizontal-nav">
<ul>
<li><a href="#home">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#services">Services</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</nav>
<div class="container">
<div class="two-column">
<div>
<h2>Custom Lists</h2>
<h3>Unordered List</h3>
<ul class="fancy-list">
</ul>
<h3>Ordered List</h3>
<ol class="custom-ordered">
<li>Custom numbers</li>
<li>Circular background</li>
</ol>
</div>
<div>
<h2>Hoverable Table</h2>
<table class="hover-table">
<thead>
<tr>
<th>Header 1</th>
<th>Header 2</th>
<th>Header 3</th>
</tr>
</thead>
<tbody>
<tr>
<td>Data 1</td>
<td>Data 2</td>
<td>Data 3</td>
</tr>
<tr>
<td>Data 4</td>
<td>Data 5</td>
<td>Data 6</td>
</tr>
<tr>
<td>Data 7</td>
<td>Data 8</td>
<td>Data 9</td>
</tr>
</tbody>
</table>
</div>
</div>
<h2>Calculator</h2>
<div class="calculator">
<div>
<button onclick="calculate('add')">Add</button>
<button onclick="calculate('subtract')">Subtract</button>
<button onclick="calculate('multiply')">Multiply</button>
<button onclick="calculate('divide')">Divide</button>
<button onclick="calculate('power')">Power</button>
</div>
<p id="result"></p>
</div>
<div id="tableContainer"></div>
</div>
<script>
function showDialogs() {
alert("This is an alert!");
result;
if (isNaN(num1) || isNaN(num2)) {
return;
}
switch(operation) {
case 'add':
break;
case 'subtract':
break;
case 'divide':
if (num2 === 0) {
return;
result = num1 /
num2; break;
case 'power':
break;
table.className = 'hover-table';
document.createElement('tr');
cell.textContent = `${i},${j}`;
row.appendChild(cell);
table.appendChild(row);
</script>
</body>
</html>
Name-Sarthak Aggarwal
Class-V-C
University number-2200290100141
Roll number-8