WT File
WT File
DEPARTMENT OF COMPUTER
APPLICATIONS
WEB TECHNOLOGIES
PRACTICAL FILE
SUBJECT CODE- BCA 105P
SUBMITTED BY: SUBMITTED TO:
3 Design a table with row span and column span and make use of
attributes (colspan, rowspan, cellpadding, cellspacing etc.).
CODE
Index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Homepage</title>
<style>
body {
background-image: url('background.jpg');
background-size: cover;
font-family: Arial, sans-serif;
color: white;
}
.container {
text-align: center;
margin-top: 50px;
}
a{
color: rgb(8, 80, 105);
text-decoration: none;
font-size: 20px;
margin: 10px;
}
.marquee {
font-size: 30px;
color: rgb(192, 53, 11);
}
</style>
</head>
<body>
<div class="container">
<h1>Welcome to HTML Tutorials</h1>
<p class="marquee"><marquee>HTML Tutorial - Learn the basics of web
development!</marquee></p>
<h2>Topics:</h2>
<ul>
<li><a href="page1.html">Formatting Styles and Headings</a></li>
<li><a href="page2.html">Font Styles and Image Tag</a></li>
<li><a href="page3.html">Marquee: Move Text, Image, and Hyperlink</a></li>
<li><a href="page4.html">Other Tags: br, hr, pre, p</a></li>
</ul>
</div>
</body>
</html>
OUTPUT
Page1.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Formatting Styles and Headings</title>
<style>
body {
font-family: 'Courier New', Courier, monospace;
background-color: #f0f0f0;
}
h1 {
font-family: 'Verdana', sans-serif;
}
a{
color: darkblue;
text-decoration: none;
}
</style>
</head>
<body>
<h1>Formatting Styles and Headings</h1>
<ul>
<li><a href="index.html">Go Back to Homepage</a></li>
<li><a href="#bold">Bold Text</a></li>
<li><a href="#italic">Italic Text</a></li>
<li><a href="#underline">Underlined Text</a></li>
<li><a href="#strike">Strikethrough Text</a></li>
<li><a href="#subscript">Subscript Text</a></li>
<li><a href="#superscript">Superscript Text</a></li>
<li><a href="#headings">Headings</a></li>
</ul>
<h2 id="headings">Headings</h2>
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
</body>
</html>
OUTPUT
Page2.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Font Styles and Image Tag</title>
<style>
body {
font-family: 'Georgia', serif;
background-color: #e8e8e8;
}
h1 {
font-family: 'Arial', sans-serif;
color: darkgreen;
}
</style>
</head>
<body>
<h1>Font Styles and Image Tag</h1>
<ul>
<li><a href="index.html">Go Back to Homepage</a></li>
<li><a href="page1.html">Formatting Styles and Headings</a></li>
</ul>
</body>
</html>
OUTPUT
Page3.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Marquee: Move Text, Image, and Hyperlink</title>
<style>
body {
font-family: 'Tahoma', sans-serif;
background-color: #e0f7fa;
}
h1 {
font-family: 'Verdana', sans-serif;
}
</style>
</head>
<body>
<h1>Marquee: Move Text, Image, and Hyperlink</h1>
<ul>
<li><a href="index.html">Go Back to Homepage</a></li>
<li><a href="page1.html">Formatting Styles and Headings</a></li>
</ul>
<h2>Text Marquee</h2>
<marquee>This is a scrolling text using the marquee tag!</marquee>
<h2>Image Marquee</h2>
<marquee><img src="example-image.jpg" alt="Example Image" width="200"></marquee>
<h2>Hyperlink Marquee</h2>
<marquee><a href="https://www.w3schools.com" target="_blank">Visit W3Schools for more
HTML Tutorials!</a></marquee>
</body>
</html>
OUTPUT
Page4.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Other Tags: br, hr, pre, p</title>
<style>
body {
font-family: 'Arial', sans-serif;
background-color: #fafafa;
}
</style>
</head>
<body>
<h1>Other Tags: br, hr, pre, p</h1>
<ul>
<li><a href="index.html">Go Back to Homepage</a></li>
<li><a href="page1.html">Formatting Styles and Headings</a></li>
</ul>
</body>
</html>
OUTPUT
Q2.
Create an unordered list nested inside an ordered list and apply the
following:
CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Ordered List with Nested Unordered List</title>
<style>
.image-container img {
position: absolute;
top: 20px;
right: 20px;
width: 150px;
height: auto;
}
.marquee-heading {
font-size: 24px;
font-weight: bold;
color: #333;
white-space: nowrap;
overflow: hidden;
width: 100%;
box-sizing: border-box;
}
.marquee-heading marquee {
font-family: 'Arial', sans-serif;
color: #ff5733;
font-size: 36px;
}
ol {
font-family: 'Verdana', sans-serif;
padding: 20px;
}
ol li {
margin: 15px 0;
font-size: 18px;
padding: 10px;
}
ol li:nth-child(1) {
color: #2e8b57;
font-style: italic;
}
ol li:nth-child(2) {
color: #1e90ff;
font-weight: bold;
}
ol li:nth-child(3) {
color: #ff6347;
font-size: 20px;
}
ol li:nth-child(4) {
color: #8a2be2;
text-transform: uppercase;
}
ol li:nth-child(5) {
color: #ff1493;
font-family: 'Courier New', Courier, monospace;
}
ol li::after {
content: "";
display: block;
border-top: 2px solid #ccc;
margin-top: 10px;
}
ul {
padding-left: 20px;
}
</style>
</head>
<body>
<div class="image-container">
<img src="https://via.placeholder.com/150" alt="Main item">
</div>
<div class="marquee-heading">
<marquee>Welcome to the Ordered List Example with Nested Unordered List</marquee>
</div>
<ol>
<li>First Item
<ul>
<li>Nested Item 1</li>
<li>Nested Item 2</li>
</ul>
</li>
<li>Second Item
<ul>
<li>Nested Item 1</li>
<li>Nested Item 2</li>
</ul>
</li>
<li>Third Item
<ul>
<li>Nested Item 1</li>
<li>Nested Item 2</li>
</ul>
</li>
<li>Fourth Item
<ul>
<li>Nested Item 1</li>
<li>Nested Item 2</li>
</ul>
</li>
<li>Fifth Item
<ul>
<li>Nested Item 1</li>
<li>Nested Item 2</li>
</ul>
</li>
</ol>
</body>
</html>
OUTPUT
Q3.
Design a table with row span and column span and make use of
attributes: colspan, rowspan, width, height, cellpadding, cellspacing
etc.
CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Table with Rowspan and Colspan</title>
<style>
table {
width: 80%;
border-collapse: collapse;
margin: 20px auto;
}
th, td {
border: 2px solid #000;
padding: 15px;
text-align: center;
}
th {
background-color: #f2f2f2;
}
</style>
</head>
<body>
</body>
</html>
OUTPUT
Q4.
Design following frame:
CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Frame Layout</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
height: 100vh;
margin: 0;
}
.main-menu {
width: 250px;
background-color: #f4f4f4;
padding: 20px;
border-right: 2px solid #ccc;
}
.main-menu h2 {
text-align: center;
}
.main-menu ul {
list-style-type: none;
padding: 0;
}
.main-menu li {
margin: 15px 0;
}
.main-menu li a {
text-decoration: none;
color: #333;
font-weight: bold;
display: block;
padding: 8px 10px;
background-color: #e0e0e0;
border-radius: 4px;
}
.main-menu li a:hover {
background-color: #ddd;
}
.content {
flex-grow: 1;
padding: 20px;
background-color: #f9f9f9;
}
.content h2 {
margin-top: 0;
}
.example {
margin-top: 20px;
padding: 20px;
background-color: #e0f7fa;
border: 1px solid #00bcd4;
border-radius: 8px;
}
</style>
</head>
<body>
<div class="main-menu">
<h2>Main Menu</h2>
<ul>
<li><a href="#">Topic 1</a></li>
<li><a href="#">Topic 2</a></li>
<li><a href="#">Topic 3</a></li>
</ul>
</div>
<div class="content">
<h2>Explanation</h2>
<hr>
<p>This section will provide detailed information regarding the selected topic. The content
will expand based on the topic selected from the main menu.</p>
<div class="example">
<h3>View Example</h3>
<p>This is an example related to the selected topic.</p>
</div>
</div>
</body>
</html
OUTPUT
Q5.
Make an image map showing the usage of shape, coords, href
attributes in map definition. Link each hotspot to their respective
details. Webpages should have background color, images, font styles,
and headings.
CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>India States Image Map</title>
<style>
body {
background-color: #f0f8ff;
font-family: Arial, sans-serif;
text-align: center;
}
h1 {
color: #2c3e50;
margin-top: 30px;
}
p{
font-size: 18px;
color: #333;
}
img {
max-width: 90%;
height: auto;
border: 3px solid #333;
}
.note {
margin-top: 20px;
font-style: italic;
color: #555;
}
</style>
</head>
<body>
</body>
</html>
OUTPUT
Q6.
Design Student registration form for admission in college
CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>College Admission Registration</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h1>STUDENT REGISTRATION</h1>
<form>
<label for="name">Full Name</label>
<input type="text" id="name" name="name" required>
<label for="address">Address</label>
<textarea id="address" name="address" rows="4" required></textarea>
<button type="submit">Register</button>
</form>
</div>
</body>
</html>
CSS
body {
font-family: Arial, sans-serif;
background-color: #def7d9;
margin: 0;
padding: 0;
}
.container {
width: 350px;
margin: 50px auto;
padding: 40px;
background-color: white;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
h1 {
text-align: center;
color: #333;
}
label {
display: block;
margin: 10px 0 5px;
color: #555;
}
button {
width: 100%;
padding: 10px;
background-color:rgb(36, 235, 36);
color: white;
border: none;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
OUTPUT
Q7.
Create a webpage and show the usage of inline and external
stylesheet.
CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Inline and External Styles</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="external-style">
<p>This paragraph is styled using an external stylesheet.</p>
</div>
<p style="color: red; font-size: 20px;">This paragraph is styled using inline CSS.</p>
<div class="external-style">
<p>This text is also styled using the external stylesheet. It is within a div with the 'external-
style' class.</p>
</div>
</body>
</html>
body {
font-family: 'Arial', sans-serif;
background-color: #f0f0f0;
margin: 0;
padding: 0;
}
h1.header {
text-align: center;
color: #333;
margin-top: 50px;
}
.external-style {
background-color: #3498db;
color: white;
padding: 20px;
margin: 10px 0;
border-radius: 5px;
}
OUTPUT
Q8.
Create a webpage containing a background image and apply all
background styling attributes.
CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Background Styling Attributes</title>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Arial', sans-serif;
background-image: url('https://www.w3schools.com/w3images/forest.jpg');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
background-attachment: fixed;
color: #fff;
line-height: 1.6;
padding: 40px;
}
h1 {
text-align: center;
font-size: 3em;
margin-bottom: 20px;
}
.background-properties {
margin-top: 30px;
padding: 20px;
background-color: rgba(0, 0, 0, 0.6);
border-radius: 8px;
}
.property {
margin-bottom: 15px;
font-size: 1.2em;
}
.property span {
font-weight: bold;
color: #f39c12;
}
.property-code {
font-family: 'Courier New', Courier, monospace;
font-size: 1em;
color: #ecf0f1;
}
.background-color {
background-color: rgba(0, 0, 0, 0.4);
}
.background-image {
background-image: url('https://www.w3schools.com/w3images/lights.jpg');
}
.background-position {
background-position: bottom right;
}
.background-size {
background-size: contain;
}
.background-repeat {
background-repeat: repeat-x;
}
.background-attachment {
background-attachment: local;
}
</style>
</head>
<body>
<div class="background-properties">
<div class="property background-color">
<p><span>background-color</span>: Applied as a semi-transparent black background to
the section.</p>
<p class="property-code">background-color: rgba(0, 0, 0, 0.4);</p>
</div>
</body>
</html>
OUTPUT
Q9.
Create a webpage showing the usage of font styling attributes.
CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Font Styling Attributes</title>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Arial', sans-serif;
background-color: #f9f9f9;
color: #333;
padding: 40px;
}
h1 {
text-align: center;
font-size: 3em;
color: #2c3e50;
margin-bottom: 30px;
}
.font-size {
font-size: 1.5em;
margin-bottom: 20px;
}
.font-weight {
font-weight: 900;
margin-bottom: 20px;
}
.font-style {
font-style: italic;
margin-bottom: 20px;
}
.line-height {
line-height: 2;
margin-bottom: 20px;
}
.letter-spacing {
letter-spacing: 2px;
margin-bottom: 20px;
}
.text-transform {
text-transform: uppercase;
margin-bottom: 20px;
}
.font-family {
font-family: 'Georgia', serif;
margin-bottom: 20px;
}
.text-align {
text-align: center;
margin-bottom: 20px;
}
.text-decoration {
text-decoration: underline;
margin-bottom: 20px;
}
.text-shadow {
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
margin-bottom: 20px;
}
.font-variant {
font-variant: small-caps;
margin-bottom: 20px;
}
</style>
</head>
<body>
<div class="font-size">
<p>This text demonstrates <strong>font-size</strong> set to 1.5em, making it larger than
normal text.</p>
</div>
<div class="font-weight">
<p>This text demonstrates <strong>font-weight</strong> set to 900, making it extra
bold.</p>
</div>
<div class="font-style">
<p>This text demonstrates <strong>font-style</strong> set to italic, which makes the text
slanted.</p>
</div>
<div class="line-height">
<p>This text demonstrates <strong>line-height</strong> set to 2, which increases the
space between lines of text for better readability.</p>
</div>
<div class="letter-spacing">
<p>This text demonstrates <strong>letter-spacing</strong> set to 2px, which adds extra
space between characters.</p>
</div>
<div class="text-transform">
<p>This text demonstrates <strong>text-transform</strong> set to uppercase, making all
letters capitalized.</p>
</div>
<div class="font-family">
<p>This text demonstrates <strong>font-family</strong> set to 'Georgia', a serif font.</p>
</div>
<div class="text-align">
<p>This text demonstrates <strong>text-align</strong> set to center, which centers the
text horizontally.</p>
</div>
<div class="text-decoration">
<p>This text demonstrates <strong>text-decoration</strong> set to underline, adding an
underline to the text.</p>
</div>
<div class="text-shadow">
<p>This text demonstrates <strong>text-shadow</strong>, which gives the text a subtle
shadow effect.</p>
</div>
<div class="font-variant">
<p>This text demonstrates <strong>font-variant</strong> set to small-caps, making all
lowercase letters appear as small capital letters.</p>
</div>
</body>
</html>
OUTPUT
Q10.
Create a webpage and apply all text styling attributes using Id and
class selector.
CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Text Styling Attributes</title>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Arial', sans-serif;
background-color: #f4f4f4;
padding: 40px;
color: #333;
line-height: 1.6;
}
h1 {
text-align: center;
font-size: 2.5em;
color: #2c3e50;
margin-bottom: 30px;
}
#main-title {
font-size: 3em;
color: #3498db;
font-weight: bold;
text-transform: uppercase;
}
.highlight {
color: #e74c3c;
font-style: italic;
font-weight: 700;
}
.large-text {
font-size: 2em;
line-height: 1.4;
}
.underline-text {
text-decoration: underline;
}
.text-shadow {
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}
.uppercase {
text-transform: uppercase;
}
.lowercase {
text-transform: lowercase;
}
.capitalize {
text-transform: capitalize;
}
.bold-text {
font-weight: bold;
}
.letter-spacing {
letter-spacing: 2px;
}
.word-spacing {
word-spacing: 4px;
}
.line-height {
line-height: 2;
}
.italic-text {
font-style: italic;
}
.font-family {
font-family: 'Georgia', serif;
}
.text-align-center {
text-align: center;
}
.text-align-right {
text-align: right;
}
.text-align-left {
text-align: left;
}
.color-text {
color: #16a085;
}
</style>
</head>
<body>
<p class="large-text">This paragraph has a larger font size and line height for better
readability.</p>
<p class="capitalize">this text has its first letter capitalized using text-transform.</p>
<p class="line-height">This text has a larger line height for better readability between
lines.</p>
</body>
</html>
OUTPUT
Q11.
Create a webpage and implement all list styling attributes.
CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>List Styling Attributes</title>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Arial', sans-serif;
background-color: #fafafa;
color: #333;
padding: 40px;
line-height: 1.6;
}
h1 {
text-align: center;
color: #333;
font-size: 2.5em;
margin-bottom: 20px;
font-weight: 600;
}
h2 {
color: #2c3e50;
font-size: 1.8em;
margin-bottom: 15px;
text-transform: uppercase;
}
.list-container {
display: flex;
justify-content: space-between;
gap: 30px;
flex-wrap: wrap;
}
ul, ol {
list-style-position: inside;
padding-left: 20px;
margin-bottom: 20px;
}
li {
font-size: 18px;
padding: 8px 0;
transition: all 0.3s ease;
}
li:hover {
background-color: #f1f1f1;
padding-left: 25px;
}
.unordered {
list-style-type: disc;
}
.circle {
list-style-type: circle;
}
.square {
list-style-type: square;
}
.decimal {
list-style-type: decimal;
}
.lower-alpha {
list-style-type: lower-alpha;
}
.upper-alpha {
list-style-type: upper-alpha;
}
.lower-roman {
list-style-type: lower-roman;
}
.upper-roman {
list-style-type: upper-roman;
}
.custom-bullet {
list-style-type: none;
}
.custom-bullet li {
position: relative;
padding-left: 30px;
}
.custom-bullet li::before {
content: "★";
position: absolute;
left: 0;
top: 0;
color: #ff6347;
font-size: 22px;
}
.image-bullet {
list-style-image: url('https://www.clipartkey.com/mpngs/m/3-33174_light-blue-circle-
png.png');
}
.list-container div {
background: #fff;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
padding: 20px;
width: 30%;
min-width: 250px;
}
.list-container div h2 {
text-align: center;
font-size: 1.5em;
color: #3498db;
}
.list-container div {
width: 80%;
}
}
</style>
</head>
<body>
<div class="list-container">
<div>
<h2>Unordered Lists</h2>
<ul class="unordered">
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>
<ul class="circle">
<li>Item A</li>
<li>Item B</li>
<li>Item C</li>
</ul>
<ul class="square">
<li>Item X</li>
<li>Item Y</li>
<li>Item Z</li>
</ul>
</div>
<div>
<h2>Ordered Lists</h2>
<ol class="decimal">
<li>First</li>
<li>Second</li>
<li>Third</li>
</ol>
<ol class="lower-alpha">
<li>a</li>
<li>b</li>
<li>c</li>
</ol>
<ol class="upper-alpha">
<li>A</li>
<li>B</li>
<li>C</li>
</ol>
<ol class="lower-roman">
<li>i</li>
<li>ii</li>
<li>iii</li>
</ol>
<ol class="upper-roman">
<li>I</li>
<li>II</li>
<li>III</li>
</ol>
</div>
<div>
<h2>Custom and Image Bullets</h2>
<ul class="custom-bullet">
<li>Custom Bullet 1</li>
<li>Custom Bullet 2</li>
<li>Custom Bullet 3</li>
</ul>
<ul class="image-bullet">
<li>Image Bullet 1</li>
<li>Image Bullet 2</li>
<li>Image Bullet 3</li>
</ul>
</div>
</div>
</body>
</html>
OUTPUT
Q12.
Create a webpage with three equal columns.
CODE
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Three Equal Columns</title>
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
padding: 20px;
}
.container {
display: flex;
justify-content: space-between;
gap: 20px;
}
.column {
flex: 1;
background-color: #fff;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
}
h2 {
color: #333;
}
</style>
</head>
<body>
<div class="container">
<div class="column">
<h2>Column 1</h2>
<p>This is the first column. You can add any content here, such as text, images, or other
elements.</p>
</div>
<div class="column">
<h2>Column 2</h2>
<p>This is the second column. The content will be evenly spaced with the other
columns.</p>
</div>
<div class="column">
<h2>Column 3</h2>
<p>This is the third column. All three columns are equal in width and aligned in a
row.</p>
</div>
</div>
</body>
</html>
OUTPUT