Share this postIt’s time to use a new way for centering elements with position: absolutecssisntmagic.substack.comCopy linkFacebookEmailNoteOtherIt’s time to use a new way for centering elements with position: absoluteStas MelnikovSep 13, 20231Share this postIt’s time to use a new way for centering elements with position: absolutecssisntmagic.substack.comCopy linkFacebookEmailNoteOther12ShareDo you still use the old snippet to the center element with position: absolute using transform(-50%, -50%)? It’s time to use a new alternative! Meet place-items: center 😉❤ Thank you so much, my sponsors: Tatiana Ten
My favorite way for centering an element is
parent {
display: flex;
align-items: center;
justify-content: center;
}