xxxxxxxxxx
~/Library/Developer/Xcode/DerivedData
xxxxxxxxxx
/* Assume the div has a class of "center"
The below would center it horizontally
*/
.center {
margin-left: auto;
margin-right: auto;
}
/* There is a shorthand and it is given below */
.center {
margin: 0 auto;
}
xxxxxxxxxx
div.center {
text-align: center;
align-items: center;
align-self: center;
justify-content: center;
justify-self: center;
justify-items: center;
justify-tracks: center;
text-justify: center;
place-items: center;
place-self: center;
padding-left: center;
vertical-align: middle;
line-height: 100%;
margin: auto;
position: absolute;
left: 50%;
right: 50%;
transform: translate(-50%, -50%);
}
xxxxxxxxxx
.parent {
display : flex;
justify-content : center;
align-items : center;
}
xxxxxxxxxx
.parentDiv {
display: flex;
justify-content: center;
align-items: center;
}
xxxxxxxxxx
.container {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
xxxxxxxxxx
.container {
width: 500px;
height: 250px;
margin: 50px;
outline: solid 1px black;
}
.circle {
width: 50px;
height: 50px;
border-radius: 50%;
background-color: black;
}