css - Wrapper with "margin: auto" gets pushed to left once it's filled with content -
i've empty document div named wrapper in it. has margin: auto.
if add more than, let's say, 15 lines of content it, get's pushed left 10 - 9px. there way fix it?
thanks lot!
i'm guessing gets pushed left scrollbar comes on right side of viewport. margin:auto
keep wrapper in middle of parent. let's window 800px
wide , wrapper 400px
wide, have 200px
on each side of because margin:auto
keep in middle. add content wrapper , content makes wrapper grow more height of window. scrollbar appears on right , window still 800px
, viewport has become 20 pixels less wide in order show scrollbar. result total width of page has shrunken 780px
instead of 800px
, margin:auto
move wrapper 10px
left.
Comments
Post a Comment