Search code examples
htmlcssstylesheethtml4

What is the fewest number of divs that could be used to create the following page layout?


update

http://www.jsfiddle.net/dougrchamberlain/nMkxE/

See how it all falls apart. the width of the id=middle should span the entire remaining center #left:width - #wrapper:width = #middle:width

if #right contains any content then

(#left:width + #right:width) - #wrapper:width = #middle:width

latest edit

Just for everyon's information. The image below was created in MSpaint. No HTML used at all.

edit

This is not supposed to be a trick question. plus please only consider html4 as an option. apparently I missed the HTML4 tag. Also, are you all considering the fact that the right pane should be collapsed when empty.

Div layout structure

Not including any nested divs for the actual features, ie menus content areas etc...

My count is 6???


Solution

  • If you don't have to wrap your elements in a fixed width div, you only need 5 - otherwise 6.

    1. header
    2. left
    3. middle
    4. right
    5. footer
    6. wrapper (optional)

    I just hope you're not trying to save a few bytes by minimizing the amount of divs for the layout :)