Skip to content

Instantly share code, notes, and snippets.

@jasdeepkhalsa
Created May 23, 2022 14:16
Show Gist options
  • Save jasdeepkhalsa/bb5f0411d3db6fab85602ff688c2de3a to your computer and use it in GitHub Desktop.
Save jasdeepkhalsa/bb5f0411d3db6fab85602ff688c2de3a to your computer and use it in GitHub Desktop.
Center horizontally without using calc or a fixed width
.center {
postion: absolute;
left: 50%;
transform: translateX(-50%);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment