center ellements in css code example
Example 1: centering css elements
// add to the parent element
.parent {
display: grid;
place-items: center;
}
Example 2: center elemnts css
margin-left: auto;
margin-right: auto;
// add to the parent element
.parent {
display: grid;
place-items: center;
}
margin-left: auto;
margin-right: auto;