wt-practical-file
wt-practical-file
Wt practical file
HMR
INSTITUTE OF TECHNOLOGY AND
MANAGEMENT
PRACTICAL FILE
Web Technology
CIE-356P
FOR
BACHELOR OF TECHNOLOGY, 3RD YEAR
DEPARTMENT-COMPUTER SCIENCE AND
ENGINEERING
INDEX
S.NO. AIM OF EXPERIMENT EXPERIMENT SUBMISSION REMARKS SIG.
DATE DATE
EXPERIMENT – 1
AIM - Design web pages for your college containing a description of the courses,
departments, faculties, library etc, use href, list tags.
CODE:
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1 />
<title>EXPERIMENT -1 | WEB TECHNOLOGY </title>
</head>
<body>
<header>
<h2 class="logo">HMRITM</h2>
<div>
<nav class="navigation">
<a href="#homepage">Home</a>
<a href="#courses">Courses</a>
<a href="#departments">Departments</a>
<a href="#faculties">Faculties</a>
<a href="#library">Library</a>
</nav>
</div>
</header>
<main>
<section class="section" id = "home">Home</section>
<section class="section" id = "courses">Courses</section>
<section class="section" id = "departments">Departments</section>
<section class="section" id = "faculties">Faculties</section>
<section class="section" id = "library">Library</section>
</main>
<footer>
<p>© 2024, All rights reserved by Aditya Goyal</p>
</footer>
</body>
OUTPUT:
EXPERIMENT – 2
AIM - Write html code to develop a web page having two frames that divide the
webpage into two equal rows and then divide the row into equal columns fill each
frame with a different background color
CODE:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Experiment - 2 | Web technology</title>
<style>
body,
html {
height: 100%;
margin: 0; }
.row {
width: 100%;
height: 50%;
display: flex; }
.column {
flex: 1;
}
.frame1 {
background-color: blueviolet; }
.frame2 {
background-color: lightgreen; }
</style>
</head>
<body>
<div class="row frame1">
<div class="column" style="background-color: rgb(128, 240, 204)"></div>
<div class="column" style="background-color: seagreen"></div>
</div>
<div class="row frame2">
<div class="column" style="background-color: navajowhite"></div>
<div class="column" style="background-color: darkgray"></div>
</div>
</body>
</html>
OUTPUT:
EXPERIMENT – 3
AIM - Design a web page of your home town with an attractive background
color, text color, an Image, font etc. (use internal CSS).
CODE:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Experiment - 3 | Web technology</title>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
user-select: none;
color: azure;
font-family: "poppins", "sans-serif";
}
body {
display: flex;
flex-direction: column;
background: linear-gradient(to bottom right, #cd7bd6, #0fb3ee);
justify-content: center;
align-items: center;
min-height: 100vh;
}
::-webkit-scrollbar {
display: none;
}
main {
width: 100%;
height: 100%;
}
header {
position: fixed;
top: 0;
left: 0;
width: 100%;
padding: 20px 50px;
display: flex;
justify-content: space-between;
align-items: center;
}
.burger span {
display: block;
position: absolute;
height: 4px;
width: 100%;
background: #fff;
border-radius: 9px;
opacity: 1;
left: 0;
transform: rotate(0deg);
transition: 0.25s ease-in-out;
}
.burger span:nth-of-type(1) {
top: 0px;
transform-origin: left center;
}
.burger span:nth-of-type(2) {
top: 50%;
transform: translateY(-50%);
transform-origin: left center;
}
.burger span:nth-of-type(3) {
top: 100%;
transform-origin: left center;
transform: translateY(-100%);
}
.burger input:checked ~ span:nth-of-type(1) {
transform: rotate(45deg);
top: 0px;
left: 5px;
}
.burger input:checked ~ span:nth-of-type(2) {
width: 0%;
opacity: 0;
}
.burger input:checked ~ span:nth-of-type(3) {
transform: rotate(-45deg);
top: 28px;
left: 5px;
}
@media (max-width: 945px) {
.burger {
display: block;
}
.navigation {
display: none;
}
.logo {
font-size: 1.4rem;
}
.home {
flex-direction: column;
}
.about {
flex-direction: column;
}
.attractions {
flex-direction: column-reverse;
}
.activities {
flex-direction: column;
}
}
.mobile-nav {
position: absolute;
top: 70px;
right: 0;
flex-direction: column;
background: transparent;
background-color: rgba(0, 0, 0, 0.3);
backdrop-filter: blur(10px);
padding: 20px;
display: none;
}
.mobile-nav nav {
display: flex;
align-items: start;
flex-direction: column;
gap: 10px;
}
.mobile-nav nav a {
font-size: 1.3em;
color: #fff;
text-decoration: none;
font-weight: 700;
padding: 10px;
}
.mobile-nav nav a:hover {
color: #80ddff;
}
section {
min-height: 100vh;
padding: 6rem 9% 2rem;
}
.home {
display: flex;
justify-content: center;
align-items: center;
gap: 10px;
background: transparent;
background-color: rgba(0, 0, 0, 0.6);
}
h1 {
font-size: 2.5rem;
font-weight: 700;
line-height: 1.3;
}
p{
font-size: 1.6rem;
}
.hometownName {
color: #4dd0ff;
}
.homeimg img {
width: 350px;
height: 350px;
border-radius: 50%;
box-shadow: 0px 0px 30px #fff;
}
.about {
display: flex;
justify-content: center;
align-items: center;
gap: 20px;
background: transparent;
background-color: rgba(0, 0, 0, 0.4);
}
.aboutimg img {
width: 350px;
height: 350px;
border-radius: 40px;
box-shadow: 0px 0px 30px #fff;
}
.attractions {
display: flex;
justify-content: center;
align-items: center;
gap: 20px;
background: transparent;
background-color: rgba(0, 0, 0, 0.3);
}
.attractions-content ul p {
font-size: 1.7rem;
font-weight: 700;
margin-bottom: 10px;
}
.attractions-content ul li {
font-size: 1.6rem;
}
.activities {
display: flex;
justify-content: center;
align-items: center;
gap: 40px;
background: transparent;
background-color: rgba(0, 0, 0, 0.2);
}
.activities-content ul p {
font-size: 1.7rem;
font-weight: 700;
margin-bottom: 10px;
}
.activities-content ul li {
font-size: 1.6rem;
}
footer {
background: #000;
display: flex;
width: 100%;
padding: 1.2rem;
color: #fff;
justify-content: center;
align-items: center;
}
footer p {
font-size: 1.3rem;
}
</style>
</head>
<body>
<header>
<a href="#home" class="homeLink">
<h2 class="logo">Bodh Gaya, Bihar</h2>
</a>
<div>
<nav class="navigation">
<a href="#about">About</a>
<a href="#attractions">Attractions and Landmarks</a>
<a href="#activities">Outdoor Activities</a>
</nav>
<label class="burger" for="burger">
OUTPUT:
EXPERIMENT – 4
AIM - Use External, Internal, and Inline CSS to format the college web page that
you created.
CODE:
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Experiment - 4 | Web technology</title>
<link rel="stylesheet" href="EXP-4.css" />
</head>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
user-select: none;
font-family: "poppins", "sans-serif";
}
body {
display: flex;
flex-direction: column;
background: linear-gradient(to bottom right, #e600ff, #00aff0);
justify-content: center;
align-items: center;
min-height: 100vh;
}
::-webkit-scrollbar {
display: none;
}
header {
position: fixed;
top: 0;
left: 0;
width: 100%;
padding: 20px 50px;
display: flex;
justify-content: space-between;
align-items: center;
background-color: rgba(0, 0, 0, 0.5);
}
.navigation a {
position: relative;
font-size: 1.3em;
color: #fff;
Downloaded by Shivam Gupta ([email protected])
lOMoARcPSD|45228015
text-decoration: none;
font-weight: 700;
margin-left: 40px;
}
.navigation a::after {
content: "";
position: absolute;
width: 100%;
height: 3px;
background: #00aff0;
border-radius: 5px;
left: 0;
bottom: -5px;
transform: scaleX(0);
transition: transform 0.5s;
}
.navigation a:hover::after {
transform: scaleX(1);
}
</style>
<body>
<header>
<h2 class="logo" style="font-size: 3em; color: #fff; user-select:
none">
HMRITM
</h2>
<div style="display: flex; justify-content: center; align-items:
center">
<nav class="navigation">
<a href="#home">Home</a>
<a href="#courses">Courses</a>
<a href="#departments">Departments</a>
<a href="#faculties">Faculties</a>
<a href="#library">Library</a>
</nav>
</div>
</header>
<main>
<section class="section" id="home">Home</section>
<section class="section" id="courses">courses</section>
<section class="section" id="departments">departments</section>
<section class="section" id="faculties">faculties</section>
<section class="section" id="library">library</section>
</main>
<footer
style="
background: #000;
display: flex;
width: 100%;
padding: 1.2rem;
color: #fff;
justify-content: center;
align-items: center;
">
<p style="font-size: 1.3rem">© 2024, All rights reserved</p>
</footer>
</body>
</html>
CSS:
.burger {
position: relative;
width: 40px;
height: 30px;
background: transparent;
cursor: pointer;
display: none; }
.burger input {
display: none;
}
.burger span {
display: block;
position: absolute;
height: 4px;
width: 100%;
background: #fff;
border-radius: 9px;
opacity: 1;
left: 0;
transform: rotate(0deg);
transition: 0.25s ease-in-out;
}
.burger span:nth-of-type(1) {
top: 0px;
transform-origin: left center;
}
.burger span:nth-of-type(2) {
top: 50%;
transform: translateY(-50%);
transform-origin: left center;
}
.burger span:nth-of-type(3) {
top: 100%;
transform-origin: left center;
transform: translateY(-100%);
}
.burger input:checked~span:nth-of-type(1) {
transform: rotate(45deg);
top: 0px;
left: 5px;
}
.burger input:checked~span:nth-of-type(2) {
width: 0%;
opacity: 0;
}
.burger input:checked~span:nth-of-type(3) {
transform: rotate(-45deg);
top: 28px;
left: 5px;
}
@media (max-width: 940px) {
.burger {
display: block;
}
.navigation {
display: none;
}
}
main {
width: 100%; }
.section {
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
width: 100%;
font-size: 3rem;
color: #fff;
}
OUTPUT:
EXPERIMENT – 5
AIM - Create HTML Page with JavaScript which takes Integer number as input
and tells whether the number is ODD or EVEN
CODE:
<!DOCTYPE html>
<html>
<head>
<style>
body {
display: flex;
flex-direction: column;
background: linear-gradient(to bottom right, #e600ff, #00aff0);
justify-content: center;
align-items: center;
min-height: 100vh;
font-family: Arial, sans-serif;
}
.input-container {
display: flex;
flex-direction: column;
align-items: center;
background: linear-gradient(to right, rgb(172, 235, 158), rgb(204, 102, 29));
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
input[type="number"] {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
box-sizing: border-box;
border: 2px solid #00ddff;
border-radius: 4px;
outline: none;
}
button {
background-color: #4CAF50;
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
border-radius: 4px;
}
button:hover {
opacity: 0.8;
}
#result {
color: #ff0011;
margin-top: 16px;
}
</style>
</head>
<body>
<div class="container">
<div class="input-container">
<h1>Check Even or Odd</h1>
<input type="number" id="num" placeholder="Enter a number" required />
<button onclick="checkOddEven()">Check</button>
<p id="result"></p>
</div>
</div>
<script>
function checkOddEven() {
var number = document.getElementById("num").value;
var result = document.getElementById("result");
if (number === "") {
alert("Enter some input !!");
return;
}
number = parseInt(number);
if (number % 2 === 0) {
result.innerText = number + " is an Even number";
} else {
result.innerText = number + " is an Odd number";
}
}
</script>
</body>
</html>
OUTPUT :