Imzy
  • Discover communities
  • Log In
  • Sign up
  • Home
  • Discover communities
  • Log In
  • Sign up
  • About
  • Learn More
  • Contact
  • Community Policy
  • FAQ
  • Sitemap
  • Terms
  • Privacy Policy
  • Available on the App Store
  • Available on Google Play
Copyright © 2017 Saurus, Inc. All rights reserved.
print("hello world")

print("hello world")

A place for programmers of all languages to come and chat, show off what they've done, and general shop talk.

4299 members
Posted byAmJustSamin/hello_world-Jan 19 at 4:57 AM

Is that how you center in CSS?

Is that how you center in CSS?

How to center in CSS (Cascading Style Sheet)? Its a question that comes into the mind of lots of developers, Some people know some quite useful tricks about how to center things in CSS while others are still wondering what is a best way of dong it.

amjustsam
Comments2
  • JackTheFlyingJan 19 at 9:51 PM

    I do back-end development mostly, so I always forget how to do it on the rare occasions that I need to write CSS.

    I always go with the first one (margin: 0 auto;), since it's the simplest to my mind.

    • AmJustSamJan 20 at 4:13 AM

      Sure, Margin: 0 auto; is the simplest solution but remember all the other solutions exist for a reason because margin: 0 auto; doesn't work in all cases.

print("hello world")

print("hello world")

A place for programmers of all languages to come and chat, show off what they've done, and general shop talk.

4299 members
  • About
  • Sitemap
  • Terms and Conditions
  • Privacy Policy
  • Copyright © 2017 Saurus, Inc. All rights reserved.