I've got elements inside the App_body
, and I've centered them both horizontally and vertically using Flex
.
<div className="App-body">
< Element1 className="element1"/>
< Element2 />
< Element3 />
</div>
.App-body {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
All three elements are nicely centered on the screen. However, I'm trying to position the first element at the top, but it's not working as expected.
.element1{
top: 0;
}
What is the correct way to set the top margin of the first element?