%content { position: absolute; content: ""; } %container { max-width: 1280px; margin: 0 auto; padding: 20px; } %vertical-center { position: absolute; top: 50%; transform: translateY(-50%); } %horizontal-center { position: absolute; left: 50%; transform: translateX(-50%); } %absolute-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }