
Originally Posted by
antonyx
one question, confused as to how i would set the original width of the box. if for example i wanted to set the original width to 515px, what do i edit?
Everything inside the .contentBox div is fluid, so the only thing you need to set width on is that outermost div.
Bascially, see this:
Code:
.contentBox {
width:95%;
min-width:608px;
max-width:1248px;
margin:0 auto;
text-align:left;
}
* html .contentBox {
width:608px;
width:expression(
(document.body.clientWidth>1280) ? "1248px"
: ((document.body.clientWidth>640) ? "95%" : "608px")
);
}
replace with :
Code:
.contentBox {
width:515px;
margin:0 auto;
text-align:left;
}
... and you can strip the margin declaration if you don't want it auto-centering.
When designing sections I like to declare widths as little as possible, so it's possible if that box was inside a column, I'd set the width on the column and not .contentBox... since it will expand to fit whatever you put it in that way.
I generally find it's good practice to design fluid, even when working with fixed layouts -- sounds weird, but it means you can set widths on two or three containers (outer wrapper, the floated columns leaving a single column fluid), and everything else just 'fits' into place automatically... It's kind of a strange revelation that hits you when suddenly fluid is EASIER than fixed to work with because you don't have to sit there micromanaging the widths of every element.
Bookmarks