Hoje encontrei um problema que todos conhecem, mas podem não se lembrar com clareza
1.margin
.father{
width:400px;
height:400px;
background:black;
margin: 0 auto;
}
2. Posicionamento e deslocamento relativos
.father{
width:400px;
height:400px;
background:black;
position: relative;
left: 50%;
transform: translate(-50%)
}
3. Posicionamento relativo
father{
width:400px;
height:400px;
background:black;
position: relative;
left: 50%;
margin-left:-200px;
}
Lembrar