2. Create a web page using the advanced features of CSS Flexbox. Apply transitions and animations to the contents of the web page.
Fri Nov 15 2024 17:03:56 GMT+0000 (Coordinated Universal Time)
Saved by
@webtechnologies
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Basic Flexbox with Animation</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
background-color: #f0f0f0;
}
.flex-container {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
gap: 20px;
width: 80%;
max-width: 800px;
}
.flex-item {
background-color: #3498db;
color: white;
display: flex;
justify-content: center;
align-items: center;
height: 150px;
width: 30%;
font-size: 20px;
font-weight: bold;
border-radius: 8px;
transition: transform 0.3s ease, background-color 0.3s ease;
}
.flex-item:hover {
transform: scale(1.1);
background-color: #2980b9;
}
</style>
</head>
<body>
<div class="flex-container">
<div class="flex-item">Item 1</div>
<div class="flex-item">Item 2</div>
<div class="flex-item">Item 3</div>
<div class="flex-item">Item 4</div>
<div class="flex-item">Item 5</div>
<div class="flex-item">Item 6</div>
</div>
</body>
</html>
content_copyCOPY
Comments