Simple 4 Box Layout

This is a discussion on "Simple 4 Box Layout" within the Web Page Design section. This forum, and the thread "Simple 4 Box Layout are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Nov 29th, 2006, 12:31
New Member
Join Date: Nov 2006
Location: London
Age: 32
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Simple 4 Box Layout

I've been trying to do a 4 box div layout for days, but have given up on it and resorted to using a table. However, the table still causes me problems as the width I apply to the square boxes (labeled 1 and 2) does not take effect.
Can anyone get this layout to work with either divs or tables?

HTML: Select all
 
<html>
<head>
   <style>
      td { border: 1px dotted red; }
      .square { width: 50px; height: 50px; ]
   </style>
</head>
<body>
   <table>
      <tr>
         <td colspan="2">this is variable length text</td>
         <td class="square" rowspan="2">1</td>
      </tr>
      <tr>
         <td class="square" rowspan="2">2</td>
      </tr>
      <tr>
      <td colspan="2">this is some more variable length text</td>
      </tr>
   </table>
</body>
</html>
 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Nov 29th, 2006, 15:18
drd drd is offline
Up'n'Coming Member
Join Date: Dec 2005
Location: Hampshire, England, UK
Age: 28
Posts: 89
Thanks: 1
Thanked 1 Time in 1 Post
Re: Simple 4 Box Layout

Can you show us your original CSS one - would be nice to avoid tables if this is a layout.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Nov 29th, 2006, 15:52
New Member
Join Date: Nov 2006
Location: London
Age: 32
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Simple 4 Box Layout

Yes here it is, but it has some problems. The layout stretches as the top line of text gets longer (as it is meant to), but does not stretch with the bottom line of text
Also this layout depends on using exact margin sizes. This means changing the font size will screw up the layout - not good!!

HTML: Select all
[left]<html>
<head>

<style>
body { background: #fff; }
div { border: 1px dotted red }
.menu { background: #ffe; font: 10px arial; height: 100px;}
.menuLinks1 { float: left; }
.menuLinks2 { float: left; margin-top: 35px; }
.menuPicture1 { width: 50px; height: 50px; background: #efe; float: left; }
.menuPicture2 { width: 50px; height: 50px; background: #eee; float: left; }
.bottomBlock { float: left; clear: left; margin-top: -37px; }
</style>

</head>

<body>

<div class="menu">
<div class="topBlock">
<div class="menuLinks1">
this is variable length text
</div>
<div class="menuPicture1">
1
</div>
</div>
<div class="bottomBlock">
<div class="menuPicture2">
2
</div>
<div class="menuLinks2">
this is some more variable length text
</div> 
</div>
</div>

</body>[/left]
</html>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Nov 29th, 2006, 19:44
Reputable Member
Join Date: May 2006
Location: Warrington, UK
Posts: 428
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Simple 4 Box Layout

can u give us a link to something visually similar to what ur trying to acheive?

Is it a 3 column layout with a header accross the top??
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Nov 30th, 2006, 08:55
New Member
Join Date: Nov 2006
Location: London
Age: 32
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Simple 4 Box Layout

Like this, with the long thin boxes containing text.

As the text length increases in the top thin box, the box should stretch to fit the text, the righthand square should be pushed to the right and the bottom thin box should stretch so it's right edge keeps in line with the right edge of the righthand square. If the text in the bottom thin box is longer than the text in the top thin box, the right edge of the top thin box should stretch so it's right edge keeps in line with the left edge of the righthand square.

Basically the text should never wrap, the square boxes should remain the same size and the whole thing should remain a rectangle.

It seems a simple layout, but I'm not sure it's possible without very conveluted CSS.


Last edited by bluemeany; Nov 30th, 2006 at 09:11.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Nov 30th, 2006, 09:42
Daniel's Avatar
Elite Veteran
Join Date: Sep 2006
Location: The Kingdom of Rabbits
Age: 22
Posts: 2,051
Blog Entries: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Simple 4 Box Layout

simple

lets have a look
Last Blog Entry: Assassin's Creed (Nov 22nd, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Nov 30th, 2006, 11:09
Reputable Member
Join Date: May 2006
Location: Warrington, UK
Posts: 428
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Simple 4 Box Layout

Quote:
Originally Posted by bluemeany View Post
Like this, with the long thin boxes containing text.

As the text length increases in the top thin box, the box should stretch to fit the text, the righthand square should be pushed to the right and the bottom thin box should stretch so it's right edge keeps in line with the right edge of the righthand square. If the text in the bottom thin box is longer than the text in the top thin box, the right edge of the top thin box should stretch so it's right edge keeps in line with the left edge of the righthand square.

Basically the text should never wrap, the square boxes should remain the same size and the whole thing should remain a rectangle.

It seems a simple layout, but I'm not sure it's possible without very conveluted CSS.


From your discription it sounds like what your trying to create will result in horizontal scroll bars on your webpage if the content ever grew enough, since your text isnt wrapping.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Nov 30th, 2006, 11:37
New Member
Join Date: Nov 2006
Location: London
Age: 32
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Simple 4 Box Layout

Not really. I'm trying to make a menu like this. The links will change so it can't be fixed width. The boxes will contain images.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Nov 30th, 2006, 14:13
drd drd is offline
Up'n'Coming Member
Join Date: Dec 2005
Location: Hampshire, England, UK
Age: 28
Posts: 89
Thanks: 1
Thanked 1 Time in 1 Post
Re: Simple 4 Box Layout

hmmmm.
So it sounds like its going to be fluid?

Well, I'd put all those divs in a container set to position relative to keep them together. Then Id position absolute the square divs and give the menu divs a margin on the left and right (top one right, bottom one would have left margin) so they dont go over/under the position absolute divs. Then the menu divs dont need a set width so can expand when menu items are added.

Will require some fettling probably to get it to work, but I based that idea on a fluid layout here:
http://www.glish.com/css/7.asp
Ignore the voice-family box model hacks.

Tell me if I've misunderstood!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
divs, layouts, tables

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] simple layout problem saltedm8 Web Page Design 13 May 2nd, 2008 18:02
CSS Layout Issue (in Firefox only)... probably simple but its driving me crazy! alfandango Web Page Design 4 Mar 8th, 2008 18:11
Just want simple Background Song (.mp3) and a simple start/stop. BlackReef Flash & Multimedia Forum 4 Jun 28th, 2007 07:04
Fluid layout - IE6 clichés the layout when resizing cyberseed Web Page Design 7 Jun 16th, 2007 05:14
Help needed to slice a site (Simple layout) shorn Starting Out 1 Apr 23rd, 2007 12:43


All times are GMT. The time now is 14:35.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved