WT Practical 1 To 5
WT Practical 1 To 5
Aim: To design web pages for a college that includes descriptions of courses, departments, faculties, library,
etc., utilizing HTML elements such as hyperlinks (<a>), lists (<ul>, <ol>), and other relevant tags.
Tools Used: Text Editor (e.g., Visual Studio Code, Sublime Text), Web Browser (e.g., Google Chrome, Mozilla
Firefox)
Theory:
A website is a collection of web pages that provide information to users. HTML (HyperText Markup Language)
is used to create structured content on the web. In this practical:
• The <a> (anchor) tag is used to create hyperlinks, allowing users to navigate between sections of the
page or different web pages.
By using these elements, we create an interactive and well-structured webpage for the college website.
Code :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>College Webpage</title>
</head>
<body>
<ul>
<li><a href="#departments">Departments</a></li>
<li><a href="#faculty">Faculty</a></li>
<li><a href="#library">Library</a></li>
</ul>
<ul>
<li>B.Tech</li>
</ul>
<h2 id="departments">Departments</h2>
<ol>
<li>Computer Science</li>
<li>Information Technology</li>
<li>Electronics</li>
<li>Mechanical</li>
</ol>
<h2 id="faculty">Faculty</h2>
<p>Our faculty members are highly qualified and experienced in their respective fields..</p>
<h2 id="library">Library</h2>
<footer>
</footer>
</body>
</html>
Output:
Practical - 2
Aim: Write HTML code to develop a webpage 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.
Tools Used: Text Editor (e.g., Visual Studio Code, Sublime Text), HTML, Web Browser (e.g., Google Chrome,
Mozilla Firefox)
Theory:
Frames allow multiple documents to be displayed within a single webpage. The <frameset> tag divides the
browser window into multiple resizable sections.
o The rows="50%,50%" attribute divides the webpage into two equal horizontal sections.
o The cols="50%,50%" attribute further divides each row into two equal columns.
• The <frame> tag: Specifies the HTML document or background color for each frame.
Frames are useful for navigational layouts but are now considered outdated in favor of CSS Flexbox/Grid for
better responsiveness.
Code :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
margin: 0;
height: 100vh;
.frame {
display: flex;
flex-direction: column;
height: 100%;
.row {
flex: 1;
display: flex;
.column {
flex: 1;
.top-left {
background-color: lightblue;
.top-right {
background-color: lightgreen;
.bottom-left {
background-color: lightcoral;
.bottom-right {
background-color: lightgoldenrodyellow;
</style>
</head>
<body>
<div class="frame">
<div class="row">
<div class="row">
</div>
</div>
</body>
</html>
Output:
Practical - 3
Aim: To design a web page representing your hometown with an attractive background color, text color, an
image, and customized font styles using internal CSS.
Tools Used: Text Editor (e.g., Visual Studio Code, Sublime Text), Web Browser (e.g., Google Chrome, Mozilla
Firefox)
Theory:
Cascading Style Sheets (CSS) is used to style HTML elements. CSS allows customization of:
1. Internal CSS (used in this practical) – defined within <style> tags in the HTML document.
2. External CSS – written in a separate .css file and linked to the HTML file.
3. Inline CSS – applied directly to HTML elements using the style attribute.
Using internal CSS, we enhance the visual appearance of the webpage while keeping the structure and styling
separate from content.
Code :
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>My Hometown</title>
<style>
body {
background-color: #f0f8ff;
color: #333;
font-family: 'Arial', sans-serif;
text-align: center;
padding: 20px;
h1 {
p{
img {
height: auto;
</style>
</head>
<body>
<h1>Welcome to My Hometown</h1>
<img src="
https://imgs.search.brave.com/Uu02N0VfKsBwpYug38KIhYqM5kXT3QqddVyQj4Z8udw/rs:fit:860:0:0:0/g:ce/aH
R0cHM6Ly93YWxs/cGFwZXJzLmNvbS9p/bWFnZXMvZmVhdHVy/ZWQvaGlsbC1waWN0/dXJlcy0ybmZjc2lz/Ym5j
d2U3MXl2Lmpw/Zw" alt="Beautiful view of my hometown">
<p>My hometown is a beautiful place known for its scenic landscapes and vibrant culture. It is a perfect blend
of nature and modernity.</p>
<ul>
</body>
</html>
Output:
Practical - 4
Aim: Use External, Internal, and Inline CSS to format the college web page that you created.
Tools Used: Text Editor (e.g., Visual Studio Code, Sublime Text), Web Browser (e.g., Google Chrome, Mozilla
Firefox)
Theory:
CSS (Cascading Style Sheets) allows the separation of content and design, making webpages more structured
and aesthetically appealing.
Types of CSS:
o Applied directly to an HTML element (<h1 style="color: red;">), overriding external and internal
styles.
By combining all three types of CSS, we create a structured, reusable, and customizable college website layout.
Code:
<!DOCTYPE html>
<html lang="en">
<head>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
user-select: none;
body {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
::-webkit-scrollbar {
display: none;
header {
position: fixed;
top: 0;
left: 0;
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
.navigation a {
position: relative;
font-size: 1.3em;
color: #fff;
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);
.navigation a:hover::after {
transform: scaleX(1);
main {
width: 100%;
text-align: center;
}
.section {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
min-height: 100vh;
width: 100%;
font-size: 2rem;
color: #fff;
.content {
padding: 20px;
border-radius: 10px;
max-width: 80%;
footer {
background: #000;
display: flex;
width: 100%;
padding: 1.2rem;
color: #fff;
justify-content: center;
align-items: center;
</style>
</head>
<body>
<header>
<h2 class="logo" style="font-size: 3em; color: #fff; user-select: none;">
HMRITM
</h2>
<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>
<div class="content">
</div>
</section>
<div class="content">
<h2>Courses Offered</h2>
<ul>
</ul>
</div>
</section>
<h2>Departments</h2>
<ol>
<li>Computer Science</li>
<li>Electronics</li>
<li>Mechanical</li>
</ol>
</div>
</section>
<div class="content">
<h2>Our Faculties</h2>
<p>Our experienced faculty members are from reputed universities and industries, ensuring quality
education.</p>
</div>
</section>
<div class="content">
<h2>Library</h2>
<p>The library contains thousands of books, research papers, and digital resources for students and
faculty.</p>
</div>
</section>
</main>
<footer>
</footer>
</body>
</html>
Output:
Practical - 5
Aim: Create HTML Page with JavaScript which takes Integer number as input and tells whether the number is
ODD or EVEN
Tools Used: Text Editor (e.g., Visual Studio Code, Sublime Text), Web Browser (e.g., Google Chrome, Mozilla
Firefox)
Theory:
JavaScript (JS) is a scripting language that allows dynamic behavior on webpages. It can handle user input,
calculations, and event handling.
• The prompt() function is used to take user input (optional in this case).
o Otherwise, it is odd.
• Event handling (onclick event) is used to execute JavaScript code when a button is clicked.
JavaScript enhances user interaction, making the webpage interactive rather than static.
Code:
<!DOCTYPE html>
<html>
<head>
<title>Odd or Even Checker</title>
<script>
function checkNumber() {
let num = parseInt(document.getElementById("numInput").value);
if (isNaN(num)) {
alert("Please enter a valid number");
} else {
let result = (num % 2 === 0) ? "Even" : "Odd";
document.getElementById("result").innerText = "The number is " + result;
}
}
</script>
</head>
<body>
<h1>Odd or Even Checker</h1>
<input type="text" id="numInput" placeholder="Enter a number">
<button onclick="checkNumber()">Check</button>
<p id="result"></p>
</body>
</html>
Output: