Ex no : 3 Cascading Style Sheets (CSS3)
Date : 16-02-2024
Aim:
To create html web page using css3.
Procedure:
Step1 : The title of the webpage is "Apollo Hospital". It links to an external stylesheet named
"styles.css" and contains internal styles for various elements.
Step 2: The header ontains the title "Apollo Hospital" and a link for "Signup/Login".
Step 3: Description Section: Provides a brief welcome message to visitors about the hospital's
commitment to exceptional healthcare services.
Step 4: Facilities Section: Lists hospital facilities with images (facility1.jpeg, facility2.jpeg,
facility3.jpeg) and a descriptive paragraph about emergency rooms.
Step 5: Services Section: Displays various services offered by the hospital using images
(service1.png, service2.png, service3.png).
Step 6: The form has two input fields: one for the username and another for the password.
Both are required fields. The form submits to "#" (which means it stays on the same page)
using the POST method.
Step 7: The styling is done inline within <style> tags. It sets up the layout, font styles, input
field styles, and button styles for the login form. The form is styled to have a background
color, padding, border radius, and a shadow effect.
Source code:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Apollo Hospital</title>
<link rel="stylesheet" href="styles.css">
<style>
.inline-text {
color: blue;
font-size: 24px;
22CSEA59 – SIVASAKTHIVEL P
}
#head{
color:blue;
font-size:20px ;
text-align: center;
}
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
}
header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
height: 10px;
}
.signup-login {
text-decoration: none;
color: green;
}
.description {
padding: 20px;
color: #333;
}
.facilities {
padding: 20px;
}
.facilities table {
22CSEA59 – SIVASAKTHIVEL P
border-collapse: collapse;
}
.facilities table td {
padding: 10px;
}
.image-form {
position: relative;
padding: 20px;
}
#fixed-image {
position: fixed;
top: 20px;
right: 20px;
width: 150px;
cursor: pointer;
border-radius: 50%;
}
.form-container {
position: absolute;
top: 0;
right: 0;
padding: 20px;
border: 1px solid #ccc;
background-color: #f9f9f9;
display: none;
}
.services {
padding: 20px;
}
.service-images {
22CSEA59 – SIVASAKTHIVEL P
display: flex;
overflow: hidden;
}
.service-images img {
width: 200px;
margin-right: 20px;
animation: slide-in 3s infinite;
}
@keyframes slide-in {
0% { transform: translateX(0); }
100% { transform: translateX(-100%); }
}
.text-effect {
text-align: center;
text-transform: uppercase;
font-size: 36px;
font-weight: bold;
color: #4CAF50;
text-shadow: 2px 2px #FF0000;
}
</style>
</head>
<body>
<header>
<h1>Apollo Hospital</h1>
<a href="login.html" class="signup-login">Signup/Login</a>
</header>
<section class="description">
<p>Welcome to Apollo Hospital. We are committed to providing exceptional healthcare
services to our patients.</p>
</section>
22CSEA59 – SIVASAKTHIVEL P
<section class="facilities">
<h2>Facilities</h2>
<img src="facility1.jpeg" alt="Facility 1">
<img src="facility2.jpeg" alt="Facility 2">
<img src="facility3.jpeg" alt="Facility 3">
<p>Hospitals provide emergency rooms equipped to handle medical emergencies</p>
</section>
<section class="services">
<h2>Our Services</h2>
<div class="service-images">
<img src="service1.png" alt="Service 1" class="service-img">
<img src="service2.png" alt="Service 2" class="service-img">
<img src="service3.png" alt="Service 3" class="service-img">
</div>
</section>
</body>
</html>
Login.html
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
<title>login</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
22CSEA59 – SIVASAKTHIVEL P
}
.container {
width: 300px;
margin: 0 auto;
padding: 20px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
margin-top: 100px;
}
h2 {
text-align: center;
color: #333;
}
label {
font-weight: bold;
color: #555;
}
input[type="text"],
input[type="password"],
input[type="submit"] {
width: 100%;
padding: 10px;
margin: 8px 0;
display: inline-block;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
}
input[type="submit"] {
22CSEA59 – SIVASAKTHIVEL P
background-color: #4CAF50;
color: white;
border: none;
cursor: pointer;
}
input[type="submit"]:hover {
background-color: #45a049;
}
</style>
</head>
<body>
<div class="container">
<h2>Hospital Login</h2>
<form action="#" method="post">
<div>
<label for="username">Username:</label>
<input type="text" id="username" name="username" required>
</div>
<div>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>
</div>
<div>
<input type="submit" value="Login">
</div>
</form>
</div>
</body>
</html>
22CSEA59 – SIVASAKTHIVEL P
Output:
22CSEA59 – SIVASAKTHIVEL P
Result:
Thus the web page using css is designed successfully.
22CSEA59 – SIVASAKTHIVEL P