I just ran into a problem. Normally when I use wrappers I just set a fixed width and use margin: 0 auto to get it in the middle but this time I don't wanna set a fixed width but I still want it in the middle. I tried doing width: auto but that didn't work.
The reason I don't want it fixed is because sometimes the content will be of the page will be longer than others and I don't want to much white-space around the edges.
Wrapper Width
Re: Wrapper Width
if your not setting a fixed width then you have nothing to center as it will stretch across the entire width of the page.
if you want some white space around the edge, add a side margin.
if you want some white space around the edge, add a side margin.
Re: Wrapper Width
Solved
[syntax=css]
#hidden {overflow: hidden;position:relative;}
#wrapper {left: 50%;float: left;position: relative;}
.box {
left: -50%;
float:left;
position: relative;
}
[/syntax]
[syntax=xhtml]
<div id="hidden">
<div id="wrapper">
<div class="box">
Content bla bla bla bla bla
</div>
</div>
</div>
[/syntax]
[syntax=css]
#hidden {overflow: hidden;position:relative;}
#wrapper {left: 50%;float: left;position: relative;}
.box {
left: -50%;
float:left;
position: relative;
}
[/syntax]
[syntax=xhtml]
<div id="hidden">
<div id="wrapper">
<div class="box">
Content bla bla bla bla bla
</div>
</div>
</div>
[/syntax]