+ 2
How can i center elements vertically?
I want to center the elements in this project https://code.sololearn.com/Wjih72K8EuOX/?ref=app
4 RĂ©ponses
+ 8
SoloProg You can use center tag also before the body tag and you can use css also.
+ 6
/*Maybe you like this:*/
body {
height: 100vh;
padding: 25px;
background-color: white;
color: black;
font-size: 25px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
+ 3
/* to center the elements */
body {
margin: 25%;
text-align: center;
vertical-align: middle;
}
+ 2
body {
padding: 25px;
background-color: white;
color: black;
font-size: 25px;
position: absolute;
}
.dark-mode {
background-color: black;
color: white;
}
button{
position: relative ;
padding: 15px;
font-size: 20px;
font-weight:bold;
left: 100px;
}