r/webdesign•
frankchester

This is a bit silly - help me understand this fundamental of web design?

So I just got a job as a web developer, and I feel a bit out of my depth. I've been creating websites before, but only for myself, or friends, or small companies. Now it's big websites that people actually pay good money for and I don't feel up to scratch!

One thing I really don't get the best practice for is layouts in CSS, especially using floats (which I overuse), so I was wondering if someone could tell me the 'proper' way (not that there is any 100% proper way.. I guess) to divide my content areas up sensibly.

Example. So I have a footer. On one site of the footer I want the typical copyright line. On the other side, I want a 'designed by' link.

What I would do to create this is make a footer wrapper (so footer{width:960px; height:100px;} or whatever).

Then I'd make the left container and right container. So: footerRight{width:50%;float:right;} and footerLeft{width:50%;float:left;}

I'd then stick these inside the wrapper div, and they'd sit nicely apart from eachother.

<div id="footer"> <div id="footerLeft">Leftside</div> <div id="footerRight">Right side</div> </div>

Now I guess for something as simple as this this is fine. But when I start getting into more complex nested divs I have problems. Such as, floats are seen as 'empty', so the wrapper doesn't think it has any content in it...

I'm wondering what the 'proper' way to do this is. This is all I have ever known, and I feel very stupid to have to ask!

Posted Jul 10, 2012, 11:08 AM UTC

04
Loading comments…