center with "transform"
้้ป
.centered-element {
margin: 0;
/* โญ๏ธ child ่ท้จ parent ็ๅๆจ็ณป */
position: absolute;
/* โญ๏ธ ๅ็ดๆฐดๅนณ็ฝฎไธญ */
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
็จๅผ็ขผ
Last updated
Was this helpful?