Iat I Iii Year
Iat I Iii Year
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<table>
<tr>
<th rowspan="2">Station</th>
<th colspan="2">Temperature</th>
<th rowspan="2">Humidity</th>
<th rowspan="2">Weather</th>
</tr>
<tr>
<th>Max</th>
<th>Min</th>
</tr>
<tr>
<td>USA</td>
<td>24</td>
<td>19</td>
<td>60%</td>
<td>Cloudy
</tr>
<tr>
<td>Germany</td>
<td>5</td>
<td>-1</td>
<td>70%</td>
<td>Rainy</td>
</tr> </table>
</body> </html>
2.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Application Form</title>
</head>
<body>
<h2>Application Form</h2>
<form>
<label for="first-name">First Name:</label>
<br><br>
<label for="age">Age:</label>
<br><br>
<label for="gender">Gender:</label>
<option value="male">Male</option>
<option value="female">Female</option>
<option value="other">Other</option>
</select>
<br><br>
<label>Positions Available:</label>
<br><br>
<label>Programming Languages:</label>
<label for="java">Java</label>
<label for="javascript">JavaScript</label>
<label for="python">Python</label>
<br><br>
<label for="password">Password:</label>
<br><br>
</form>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div class="product">
<h2>Smartphone X<sup>Pro</sup></h2>
<p><strong>Stock Availability:</strong></p>
<h3>Product Overview</h3>
<p>
</p>
<h3>Product Demo</h3>
</video>
<audio controls>
</audio>
<br><br>
<button>Add to Cart</button>
<button>Buy Now</button>
</div>
</body>
</html>
4. Use CSS Rounded corners for an element with a border,
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Rounded Corners</title>
<style>
.rounded-box {
width: 300px;
height: 150px;
border: 2px solid green;
border-radius: 15px; /* This makes the corners rounded */
padding: 20px;
font-size: 18px;
}
</style>
</head>
<body>
<div class="rounded-box">
Rounded corners!
</div>
</body>
</html>
5. Using HTML, CSS create a scrollable container that will snap on elements when scrolling.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Scrollable Snap Container</title>
<style>
body {
font-family: Arial, sans-serif;
}
.scroll-container {
width: 80%;
height: 300px;
border: 2px solid #333;
overflow-x: auto;
scroll-snap-type: x mandatory;
display: flex;
gap: 10px;
padding: 10px;
white-space: nowrap;
}
.scroll-item {
flex: 0 0 100%;
width: 100%;
height: 100%;
background-color: lightblue;
display: flex;
justify-content: center;
align-items: center;
font-size: 24px;
font-weight: bold;
border-radius: 10px;
scroll-snap-align: center;
}
</style>
</head>
<body>
<div class="scroll-container">
<div class="scroll-item">Item 1</div>
<div class="scroll-item" style="background-color: lightcoral;">Item 2</div>
<div class="scroll-item" style="background-color: lightgreen;">Item 3</div>
<div class="scroll-item" style="background-color: lightsalmon;">Item 4</div>
</div>
</body>
</html>
6.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Ian's Timetable</title>
</head>
<body>
<h2>Ian's Timetable</h2>
<table>
<tr>
<th rowspan="2"></th>
<th colspan="3">Morning</th>
<th>Lunch</th>
<th colspan="3">Afternoon</th>
<th colspan="4">Evening</th>
</tr>
<tr>
<td>9-10 am</td>
<td>10-11 am</td>
<td>11-12 am</td>
<td>1-2 pm</td>
<td>2-3 pm</td>
<td>3-4 pm</td>
<td>4-5 pm</td>
<td>5-6 pm</td>
<td>6-7 pm</td>
<td>7-8 pm</td>
<td>8-9 pm</td>
</tr>
<tr>
<th>Work</th>
<td></td>
<td></td>
<td>commute</td>
<td colspan="3">Free</td>
</tr>
<tr>
<td></td>
<td></td>
<td colspan="4"></td>
</tr>
<tr>
<th>Lecture</th>
<td></td>
<td colspan="3">preparation</td>
<td colspan="4"></td>
</tr>
<tr>
<td></td>
<td></td>
<td colspan="3">Free</td>
</tr>
<tr>
<th>Research</th>
<td></td>
<td colspan="3"></td>
<td colspan="4">Research</td>
</tr>
</table>
</body>
</html>
2.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Contact Us Form</title>
</head>
<body>
<form>
<label for="name">Name*:</label>
<button type="submit">Submit</button>
</form>
</body>
</html>
3. Create a basic HTML page that displays an image. The image should be centered on the page,
and it should be 300px wide while maintaining its aspect ratio.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Centered Image</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #f9f9f9;
margin: 0;
.image-container {
text-align: center;
}
img {
width: 300px;
border-radius: 10px;
margin: 20px;
</style>
</head>
<body>
<div class="image-container">
</div>
</body>
</html>
4. Explain the different CSS properties used to style links in their different states (unvisited,
visited, hover, and active). Provide an example of CSS code that demonstrates how to style links
using these states.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Styled Links</title>
<style>
a:link {
color: blue;
text-decoration: none;
a:visited {
color: purple;
a:hover {
color: red;
text-decoration: underline;
a:active {
color: orange;
background-color: yellow;
</style>
</head>
<body>
</body>
</html>
5. Using HTML, CSS create a list with floating section headings that stay fixed at the top as the
user scrolls down the page.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
body {
margin: 0;
padding: 0;
background-color: #f4f4f4;
.container {
width: 50%;
background: #fff;
border-radius: 8px;
.section-header {
position: sticky;
top: 0;
background: #007bff;
color: white;
padding: 10px;
font-size: 18px;
font-weight: bold;
.list-item {
padding: 10px;
background: white;
</style>
</head>
<body>
<div class="container">
<div class="section-header">Fruits</div>
<div class="list-item">Apple</div>
<div class="list-item">Banana</div>
<div class="list-item">Mango</div>
<div class="list-item">Grapes</div>
<div class="list-item">Orange</div>
<div class="section-header">Vegetables</div>
<div class="list-item">Carrot</div>
<div class="list-item">Broccoli</div>
<div class="list-item">Spinach</div>
<div class="list-item">Tomato</div>
<div class="list-item">Onion</div>
<div class="section-header">Dairy</div>
<div class="list-item">Milk</div>
<div class="list-item">Cheese</div>
<div class="list-item">Butter</div>
<div class="list-item">Yogurt</div>
<div class="section-header">Beverages</div>
<div class="list-item">Tea</div>
<div class="list-item">Coffee</div>
<div class="list-item">Juice</div>
<div class="list-item">Smoothie</div>
</div>
</body>
</html>