Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Center Website with Div Tag Re: Center Website with Div Tag

#68556
TT_Mark
Member

I’m not highly strung, I’m just here to try and prevent people from giving out poor advice.

A centering reset is not a good idea and would also not save a lot of time in the future unless you actually wanted to center every single element on your site. Having a regular reset, as @jamy_za pointed out, is not a problem (although there are also arguments for why these are bad…but that is another discussion!) but the command

* { margin: 0 auto }

centers everything, including divs within their parent div, paragraphs, images etc etc. If you wanted to center every element within its parent (or have the majority of elements like this), then sure, use a centering reset, but I highly doubt many people would and it would therefore be quicker (both coding and for the browser to actually parse the information) if you just centered the few elements that needed centering