Yo /prog/
I've got some basic CSS problem that I'd love help with
At the moment I've got one div for a main area that I'd like the rest of my content in, and then have 3 divs for my content (left navigation, middle content, right information, all floating left). However, I have trouble configuring my main area (I want to enclose everything in a border). I can set the width because it's static, but I the height is dynamic depending on the amount of content. However, I can't find a way to do this correctly.
If I don't fill in the height property, the main area div has a height of 0px since it has no content in it. If I set the height property to 100%, the height of the main area is always the size of your browser or something so if you have too little or too much content it's ass.
I've probably made some design mistake (unless I'm missing some obvious CSS property), how would I go about unfucking this?
Name:
Anonymous2011-11-21 15:39
dont post your code, or else we might be able to help you...
Your description is horrible. I can barely understand what you're saying. Post the code on pastebin, or better yet a link to what you currently have, ``Faggot''.
Name:
Mellow2011-11-21 15:43
Ok it's like this
<div class="mainarea">
<div class="left">
*insert content*
</div>
<div class="middle">
*insert content*
</div>
<div class="right">
*content*
</div>
</div>
with
left, middle, right
{float=left;}
and all have set widths
and
mainarea
{width=1000px;border-style=solid;margin-left=auto;margin-right=auto;}
Hope that's enough code
Can't see the HTML. I get redirected to an "under admin review" page. Format your CSS better, also.
Name:
Mellow2011-11-21 16:03
>>9
Oh what the fuck, they did that shit the second I posted the link there
And yeah I know my CSS is a mess, I've mainly been doing random shit to experiment. My php files are formatted even worse.
Thanks for the help anyway
At first using CSS for layouts is more difficult than using tables but when you really know the quirks of CSS it becomes more powerful than tables. Don't bother trying to make it work in IE6 or IE7. IE7 has a broken stacking layer and IE6 doesn't even support all the basics of CSS.
There is also a new layout model for CSS in the works -- Flexible Box Layout Module (http://www.w3.org/TR/css3-flexbox/), which addresses the quirks of CSS.
Remove the break after your header. Use margin or padding properties create space instead.