Practical 6
Practical 6
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.tailwindcss.com"></script>
<title>Practical 6a</title>
</head>
<body>
<div class="bg-green-500 text-white p-5">
<h1 class="text-3xl font-bold">Hello, Tailwind CSS!</h1>
<p class="mt-3">Welcome to FSWD lab.</p>
</div>
</body>
</html>
b) Tailwind CSS that describes how to change the background color on mouse
hover.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.tailwindcss.com"></script>
<title>Practical 6b</title>
</head>
<body>
<div class="h-full border-2 border-gray-200
border-opacity-60 rounded-lg
overflow-hidden">
<div class="p-6 hover:bg-pink-600
hover:text-white transition
duration-300 ease-in">
<h1 class="text-2xl font-semibold mb-3"> Hover over me!</h1>
</div>
</div>
</body>
</html>
b) Create a web page with fields for book title, author name, publisher name, published
year, ISBN, and quantity. Each input field is styled using Tailwind CSS utility classes
for layout, typography, and form elements.
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Book Information</title>
<link
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css"
rel="stylesheet">
</head>
<body class="bg-pink-100 p-8">
<div class="mb-4">
<label for="authorImage" class="block text-sm font-medium
text-gray-600">Author Image</label>
<input type="file" id="authorImage" name="authorImage"
class="mt-1 p-2 w-full border rounded-md">
<img id="authorImagePreview" class="mt-2" style="display:none;
max-width: 200px;">
</div>
<div class="mb-4">
<label for="bookImage" class="block text-sm font-medium text-
gray-600">Book Image</label>
<input type="file" id="bookImage" name="bookImage" class="mt-1
p-2 w-full border rounded-md">
<img id="bookImagePreview" class="mt-2" style="display:none;
max-width: 200px;">
</div>
<div class="mb-4">
<label for="isbn" class="block text-sm font-medium text-gray-
600">ISBN (13 digits)</label>
<input type="text" id="isbn" name="isbn" class="mt-1 p-2 w-
full border rounded-md" pattern="[0-9]{13}" title="ISBN must be a 13-digit
number">
</div>
<div class="mb-2">
<label for="description" class="block text-sm font-medium
text-gray-600">Description</label>
<textarea id="description" name="description" class="mt-1 p-2
w-full border rounded-md" rows="4"></textarea>
</div>
<button type="submit" class="bg-blue-500 text-white p-2 rounded-md
hover:bg-blue-700">Submit</button>
</form>
</div>
</body>
</html>