1. Flexbox 1-Dimensional Layout Engine
Flexbox (display: flex) provides a 1-dimensional layout system to distribute space, align items, and manage responsive direction along a Main Axis and a Cross Axis.
⊞HTML5 Web Code (index.html)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Flexbox Alignment Studio</title>
<style>
body {
background-color: #17181c;
color: #ffffff;
font-family: Arial, sans-serif;
padding: 30px;
}
.flex-navbar {
display: flex;
justify-content: space-between;
align-items: center;
background-color: #1f2029;
padding: 16px 24px;
border-radius: 12px;
border: 1px solid #333;
}
.nav-links {
display: flex;
gap: 16px;
list-style: none;
}
.nav-links a {
color: #04AA6D;
text-decoration: none;
font-weight: bold;
}
.flex-grid {
display: flex;
gap: 16px;
margin-top: 24px;
flex-wrap: wrap;
}
.flex-item {
flex: 1 1 200px;
background-color: #242632;
padding: 20px;
border-radius: 8px;
text-align: center;
border-top: 3px solid #04AA6D;
}
</style>
</head>
<body>
<nav class="flex-navbar">
<h2>Nextsem</h2>
<ul class="nav-links">
<li><a href="#">Home</a></li>
<li><a href="#">Courses</a></li>
<li><a href="#">Projects</a></li>
</ul>
</nav>
<div class="flex-grid">
<div class="flex-item">Box 1</div>
<div class="flex-item">Box 2</div>
<div class="flex-item">Box 3</div>
</div>
</body>
</html>
