Professional Documents
Culture Documents
dna
dna
<!DOCTYPE html>
<html>
<head>
<title>Image and Progress Bar</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<table width="640" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<img src="image.jpg" alt="Image description" width="400"
height="300" id="image">
</td>
</tr>
</table>
<footer>
<div id="progress-bar">
<div id="progress"></div>
</div>
</footer>
<script src="script.js"></script>
</body>
</html>
body {
font-family: Arial, sans-serif;
}
table {
border-collapse: collapse;
}
#progress-bar {
width: 100%;
height: 20px;
background-color: #ccc;
border-radius: 10px;
padding: 10px;
}
#progress {
width: 0%;
height: 100%;
background-color: #4CAF50;
border-radius: 10px;
}
design a navbar with home ,about and contact us page and write necessary code to
navigate to these pages
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Navbar Example</title>
<style>
/* Style the navigation bar */
.navbar {
overflow: hidden;
background-color: #333;
}
</body>
</html>
set:-1
Create the output through html
•Apple
•Samsung
1.S21
2.S22
3.S23
•Oneplus
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Product List</title>
</head>
<body>
<ul>
<li>Apple</li>
<li>Samsung
<ol>
<li>S21</li>
<li>S22</li>
<li>S23</li>
</ol>
</li>
<li>OnePlus</li>
</ul>
</body>
</html>
Make 4 boxes from div tag with height and width 200px and apply css to arrange
them in single line.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Four Boxes in a Single Line</title>
<style>
/* Style the container to center-align the boxes */
.container {
text-align: center;
}
<div class="container">
<!-- Four boxes -->
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
</div>
</body>
</html>
Set 2
Q1- Write a js program to print your name n number of times ?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Print Aman Gupta</title>
</head>
<body>
<script>
// Prompt the user to enter a number
var n = prompt("Enter the number of times to print 'Aman Gupta':");
</body>
</html>
Q2- Make a div with 200px height and width and align it in bottom right of the
webpage using css position property?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bottom Right Div</title>
<style>
/* Style the div */
.bottom-right {
width: 200px;
height: 200px;
background-color: red;
position: fixed;
bottom: 0;
right: 0;
}
</style>
</head>
<body>
</body>
</html>
Set 3
1) design login form with the following fields
-
- username with "enter username" field
- password with "enter password"field
- login button
<!DOCTYPE html> <html> <head> <style> body { font-family: Arial, Helvetica, sans-
serif; }
.container { width: 300px; padding: 16px; background-color: white; margin: 0
auto; margin-top: 100px; box-shadow: 0 0 10px rgba(0,0,0,0.1); border-radius:
5px; }
design a div box with height as well as width of 200px each and background colour
should be red. When hovering over it it should be change to yellow in colour.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hover Effect</title>
<style>
/* Style the box */
.box {
width: 200px;
height: 200px;
background-color: red;
transition: background-color 0.3s ease; /* Smooth transition */
}
Set - 5
1. Make an Array in JS which contains 5 car names. Write a program to print all the
elements of the array.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Car Names</title>
</head>
<body>
<h1>Car Names</h1>
<script>
// Array containing 5 car names
var cars = ["Toyota", "Honda", "Ford", "Chevrolet", "BMW"];
</body>
</html>
2. Make a div with height and width of 200px each and background color black and
align it to the center of the page vertically.
<!DOCTYPE html>
<html>
<head>
<title>Div Example</title>
<style>
body {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
margin: 0;
padding: 0;
background-color: #f0f0f0;
}
#myDiv {
width: 200px;
height: 200px;
background-color: #000;
}
img {
height: 300px;
width: 400px;
}
</style>
</head>
<body>
<div id="myDiv"></div>
<img src="your-image.jpg" alt="Your Image">
</body>
</html>