1.centered {
2 position: fixed;
3 top: 50%;
4 left: 50%;
5 transform: translate(-50%, -50%);
6}
1.center {
2 position: fixed;
3 top: 50%;
4 left: 50%;
5 transform: translate(-50%, -50%);
6}
1// add to the parent element
2.parent{
3 height:100vh;
4 display:flex;
5 justify-content: center;
6 align-items: center;
7}
8or you can use
9// add to the parent element
10.parent{
11 height:100vh;
12 display:gird;
13 place-item:center;
14}
1.element {
2 position: absoloute;
3 margin: auto;
4 left: 0;
5 right: 0;
6 top: 0;
7 bottom: 0;
8}