Web Lab PGM 1 To 3
Web Lab PGM 1 To 3
Develop the HTML page named as “Myfirstwebpage.html”. Add the following tags with
relevant content.
1. Set the title of the page as “My First Web Page”
2. Within the body use the following tags:
a) Moving text = “Basic HTML Tags”
b) Different heading tags (h1 to h6)
c) Paragraph
d) Horizontal line
e) Line Break
f) Block Quote
g) Pre tag
h) Different Logical Style (<b>, <u>, <sub>, <sup> etc.)
Code:
Myfirstwebpage.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My First Web Page</title>
</head>
<body>
<!-- Moving Text -->
<marquee>Basic HTML Tags</marquee>
<!-- Different Heading Tags -->
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<h3>Heading 3</h3>
<h4>Heading 4</h4>
<h5>Heading 5</h5>
<h6>Heading 6</h6>
<!-- Paragraph -->
<p>This is a paragraph demonstrating basic HTML tags and their usage.</p>
<!-- Horizontal Line -->
<hr>
<!-- Line Break -->
This is some text. <br> This is the next line after a line break.
<!-- Block Quote -->
<blockquote>
"This is a block quote, usually used for quoting someone or something significant."
</blockquote>
<!-- Preformatted Text -->
<pre>
This is preformatted text.
It preserves
the whitespace
and line breaks.
</pre>
<!-- Different Logical Styles -->
<p>
This is <b>bold</b> text. <br>
This is <i>italic</i> text. <br>
This is <u>underlined</u> text. <br>
This is <strike>strikethrough</strike> text. <br>
This is <sup>superscript</sup> text. <br>
This is <sub>subscript</sub> text. <br>
This is <strong>strong</strong> text. <br>
This is <em>emphasized</em> text.
</p>
</body>
</html>
Sample Output:
EXPERIMENT 2
Develop the HTML page named as “Table.html” to display your class time table.
a) Provide the title as Time Table with table header and table footer, row-span and col-span
etc.
b) Provide various colour options to the cells (Highlight the lab hours and elective hours
with different colours.)
c) Provide color options for rows.
Code:
TimeTable.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Time Table</title>
<!-- Internal style -->
<style>
/* Table is set to 60% width, with borders collapsed for a neat look, and
text centered */
table {
width: 60%;
border-collapse: collapse;
text-align: center;
}
/* Style for table headers and cells with black borders and padding for
spacing */
th, td {
border: 1px solid black;
padding: 10px;
}
/* Header background is green with white text for clear visibility */
th {
background-color: green;
color: white;
}
/* Footer cells have a light gray background with bold text for emphasis */
tfoot td {
background-color: lightgray;
font-weight: bold;
}
/* Special class for lab hours: highlighted with light coral */
.lab {
background-color: lightcoral; /* Highlight lab hours */
}
/* Special class for elective hours: highlighted with light green */
.elective {
background-color: lightgreen; /* Highlight elective hours */
}
/* Rows alternate between light yellow (even rows) and light cyan (odd
rows) for better readability */
tr:nth-child(even) {
background-color: lightyellow;
}
tr:nth-child(odd) {
background-color: lightcyan;
}
</style>
</head>
<body>
</body>
</html>
Sample Output:
EXPERIMENT 3
Develop an external style sheet named as “style.css” and provide different styles for h2,
h3, hr, p, div, span, time, img & a tags. Apply different CSS selectors for tags and
demonstrate the significance of each.
style.css:
Sample Output: