I’ve noticed that if I view the page at wider resolution, the content of a section gets aligned to the right, instead of centered.
I use
margin: 0 auto;
width: 998px;
overflow: hidden;
It seems to have this bug, at least in Safari, Firefox and Chrome. I tried disabling overflow: hidden and it gets rid of the bug, but messes up my floats inside the content.
You can see an example at the page live here:
http://autouncle.dk/da/brugte-biler/Kia or http://autouncle.dk/da/brugte-biler/Ford (you have to view it at at least 1500px widescreen to see the bug).
Any ideas on what can cause this bug and what are possible solutions?
About the reason of the problem: this is due to the
page-titleelement of your header:#header-outerelement contains some floated elements but you forgot a clearing, so the offset left of the main section of your site starts where thepage-titleends. (you can verify this by hidingpage-titleelement — when you setdisplay: nonethe page is correctly centered)So adding
you solve the problem
As a sidenote strongly avoid to put empty div only for clearing purposes: there’re cleaner methods that don’t require extra markup, like easyclearing