CSS Menyelaraskan Pusat Vertikal
.parent {
display: flex;
justify-content: center;
align-items: center;
}
Gleaming Grivet
.parent {
display: flex;
justify-content: center;
align-items: center;
}
/* 100vh = 100% Viewport Height */
body {
display: flex;
height: 100vh;
flex-direction: column;
justify-content: center;
}
/* add */ align-items: center; /*to also center horizontally.*/
.vertical-center {
margin: 0;
position: absolute;
top: 50%;
-ms-transform: translateY(-50%);
transform: translateY(-50%);
}
.container{
display: table;
}
.div-inside-container{
display: table-cell;
vertical-align: middle;
}
/* Flex */
.center {
display: flex;
justify-content: center;
align-items: center;
}
/* Without Flex */
.parent {
position: relative;
}
.child {
position: absolute;
top: 50%;
transform: translateY(-50%);
}
margin:auto