3
Hello, I’m learning about CSS3 and I’m trying to center one div underneath the other so it’s more or less like this:
I tried using margin-bottom: -150px It didn’t work. And I also have doubts about whether I force on pixel not to break into different layouts.
My code is this:
<body>
<div class="aaa">
<div class="bbb">
<div class="a"></div>
<div class="a"></div>
<div class="a"></div>
</div>
</div>
</body>
<style>
body {
background: black;
}
.aaa {
height: 500px;
border: 1px solid black;
background: #c72523;
position: relative;
}
.bbb {
position: absolute;
margin: auto;
width: 70%;
display: flex;
justify-content: space-between;
align-items: flex-end;
margin: auto;
}
.a {
width: 200px;
height: 300px;
border: 1px solid black;
background: red;
transition: all 200ms ease-in-out;
}
.a:hover {
transform: scale(1.5);
}
</style>