<!DOCTYPE html>
<html>
<head>
<style>
.container {
display: flex;
gap: 20px;
background: lightgray;
padding: 20px;
}
.item {
background: skyblue;
padding: 30px;
flex: 1; /* Equal width items */
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<div class="item">Box 1</div>
<div class="item">Box 2</div>
<div class="item">Box 3</div>
</div>
</body>
</html>
Explanation:
display: flex;
arranges items horizontally.gap
: spacing between items.flex: 1;
makes items share equal space.
Leave a Reply