Mixin absolute center

@mixin absolute-center($align: xy) { position: absolute; @if $align == xy { left: 50%; top: 50%; bottom: auto; right: auto; @include transform(translateX(-50%) translateY(-50%)); } @else if $align == x { left: 50%; right: auto; @include transform(translateX(-50%)); } @else if $align == y { top: 50%; bottom: auto; @include transform(translateY(-50%)); } }
Mixin to center content horizontally or vertically, regardless of sizes (without flexbox)

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.