Im creating a website where the header, footer, body are all 100% width of the page, but I need all the content to be centered of the page no matter the resolution. I’ve tried using a wrapper but then the header and stuff are only 100% width of the wrapper and not the page.
Share
I’m going out on a limb and guess that the background color/imagery is 100% wide, but you want the actual content to be centered (with a fixed width?). Here is sample code that uses an internal wrapper
divon each item to keep internal content centered. I would recommend doing something totally different and possibly using repeating backgrounds on thehtmlandbodyelements, but I don’t know what your page looks like.So.., the following will work, but will alarm HTML purists because of the extra markup 🙂
You can view a (super ugly) example of this method on this sample page I put together.
CSS:
HTML: