Forum Moderators: not2easy

Message Too Old, No Replies

Divs inside Divs inside Divs...

or am I making this too complicated?!

         

Beau

7:38 pm on Aug 16, 2004 (gmt 0)

10+ Year Member



OK - I maybe trying to make things too complex for my first site using CSS for positioning but this far (just) it seems to have been going ok. But I now have two challenges (which will only apply to one page!)

Briefly I have:
a header that spans the whole window
fixed width left column
auot sizing centre column
fixed right column

all of these are set up in an external style sheet

On the contacts page the client wants two boxes showing on the lh side the address of the shop and on the rhs the opening times. There is then more text underneath these two boxes.

I've left and right floated two more divs for these two boxes and have a couple of problems:

1. the text below will come up between the two boxes if there is space. After searching on the web I've put in a clear class but it doesn't seem to be having the desired effect (probably me implementing it wrong).

Code for this is:
CSS:
.clearer {clear: left; line-height: 0; height: 0;}
HTML:
<div classs="clearer">&nbsp;</div>

2. the client wants the opening times neatly lined up in the rh box eg:
Monday------10am-7pm
Tuesday-----10am-7pm
Wednesday---10am-6pm

How can I acheive this? Do I need another Div inside the rh box (which is inside the centrebox of my page)? Or is there a simpler / better way?

Apologies if these are basic questions and please feel free to simply point me to any resources/tutorials that will answer these questions.

TIA
Beau

randallxski

8:06 pm on Aug 16, 2004 (gmt 0)

10+ Year Member



HTML:
<div classs="clearer">&nbsp;</div>

Is this a copy and paste from your source file? If so, try correcting the spelling of 'class' and see if that helps.

drbrain

9:41 pm on Aug 16, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For the openening times use a table.

createErrorMsg

12:52 am on Aug 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



.clearer {clear: left; line-height: 0; height: 0;}

You described a left float and a right float, with text that moves in between them. This leads me to believe you need a clear:both; as opposed to clear:left.

Beau

5:06 am on Aug 17, 2004 (gmt 0)

10+ Year Member



Randalski - it's often just soooo simple isn't it!

Thanks for pointing out my stupid mistake - doh!

Thanks also to createErrorMsg - sorting these two has fixed the first problem.

Note to self: I really must try not to stare at a screen for more than 12 hours on the trot - it makes me unable to see what is in front of me 8-)

drbrain - thanks. Had been thinking I would need to resort to using a table and was wondering whether there was a CSS way around it. But I guess the answer is opening times are tabular data so there is no problem putting them in a table.

Thanks again,

Beau

GaryK

5:27 am on Aug 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In addition to validating my markup and CSS I also spell-check it to avoid this type of mistake. Why? Experience. ;)