What is the best practice configuring CSS properties to get a horizontally centered page? -


By now I have two options (maybe more than that):

  1. Set the horizontal margin of body tag width and body tag to a certain length, set it to Auto, it focuses all the contents horizontally.
  2. Create a wrapping div inside the body. Set the wrapping width of the width to a certain length and set the horizontal difference of the auto. Any material inside this wrapping device becomes horizontal.

I do not know who is better or if you have the second option that you think best, then let me know.

A wrapper division is more flexible, because you never know that when you focus an element Do not want to have a line below a few months if the site requires a change, you would be happy that you used to have a wrapper div, less work because you can make a sister of the rapper div and what you want to do with them .

He said, if this is a very simple example / site, then make sure to proceed and 0 Auto element of body.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -