Old 25-02-2004, 11:07   #1 (permalink)
sleepingfish
css is for divs
 
sleepingfish's Avatar
 
Join Date: Feb 2003
Location: Norwich
Posts: 4,527
CSS is dead, long live tables

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARGH

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ARGH

I've tried convincing everyone at work to go XHTML with CSS but godamnit, I give up, how can I convince them if I can't make some DIV's do what a table can. It should be simple. IT SHOULD BE SO SIMPLE.

Split the page into 2 parts, a top menu DIV 100 pixels high, and a main content DIV below that streches to fill the page to the bottom, but put the height to 100%, positioned 100px from the top and it will overlap the bottom of the page because it's 100px from the top.

demo url coming soon, help.
  Reply With Quote
Old 25-02-2004, 11:19   #2 (permalink)
smallbeer
I Ain't Losing Any Sleep™
 
Join Date: Apr 2003
Posts: 5,238
make the bottom div *look* like it's stretching to the bottom by using a sneaky background image the same colour as the div?
__________________
That's fuckin' ingenious, if I understand it correctly. It's a Swiss fuckin' watch.
  Reply With Quote
Old 25-02-2004, 11:19   #3 (permalink)
Stickman
Dr. Lucien Sanchez
 
Stickman's Avatar
 
Join Date: Mar 2003
Location: UK
Posts: 5,642

Put the 100px div inside the 100% height div.
  Reply With Quote
Old 25-02-2004, 11:19   #4 (permalink)
Stickman
Dr. Lucien Sanchez
 
Stickman's Avatar
 
Join Date: Mar 2003
Location: UK
Posts: 5,642
Or... do what he said.
  Reply With Quote
Old 25-02-2004, 11:24   #5 (permalink)
sleepingfish
css is for divs
 
sleepingfish's Avatar
 
Join Date: Feb 2003
Location: Norwich
Posts: 4,527
Cheers people, not sure that would fix it, head is a bit of a mess at the moment though, so I'll keep on thinkning.

Here's a beautiful example of what i want to do with CSS, done with tables.

tables
  Reply With Quote
Old 25-02-2004, 11:27   #6 (permalink)
Stickman
Dr. Lucien Sanchez
 
Stickman's Avatar
 
Join Date: Mar 2003
Location: UK
Posts: 5,642
Quote:
Originally Posted by sleepingfish
Cheers people, not sure that would fix it
The cheek of it.

Both our suggestions will do what you want.
  Reply With Quote
Old 25-02-2004, 11:32   #7 (permalink)
sleepingfish
css is for divs
 
sleepingfish's Avatar
 
Join Date: Feb 2003
Location: Norwich
Posts: 4,527
Quote:
Originally Posted by Stickman
The cheek of it.

Both our suggestions will do what you want.


Sorry, not enough caffeine perhaps, but if I start putting content in the botom section with height set to 100%, it will go over (or under) the top 100px menu won't it.

Yours trying not to be too cheeky,

James
  Reply With Quote
Old 25-02-2004, 11:41   #8 (permalink)
Stickman
Dr. Lucien Sanchez
 
Stickman's Avatar
 
Join Date: Mar 2003
Location: UK
Posts: 5,642
One way to do it:

- Make a #frame div with 100% height.
- Float a #top div with 100px height and same width as #frame.
- Float a #content div (which will be forced below it).
  Reply With Quote
Old 25-02-2004, 11:52   #9 (permalink)
sleepingfish
css is for divs
 
sleepingfish's Avatar
 
Join Date: Feb 2003
Location: Norwich
Posts: 4,527
ok, but then if I want #content to stretch full height and width, won't it go beyond the browser window because it's been forced 100px down the page already?
  Reply With Quote
Old 25-02-2004, 11:56   #10 (permalink)
Stickman
Dr. Lucien Sanchez
 
Stickman's Avatar
 
Join Date: Mar 2003
Location: UK
Posts: 5,642
Probably.

...but then you can make the layout the background image of #frame (like smallbeer said) and #content transparent - so it looks like it stretches down even if it doesn't.
  Reply With Quote
Old 25-02-2004, 12:01   #11 (permalink)
sleepingfish
css is for divs
 
sleepingfish's Avatar
 
Join Date: Feb 2003
Location: Norwich
Posts: 4,527
That's what I'm afraid of having to resort to, but then if #content has too much text or images it will all get buggered. Why does the stupid client want it all to stretch 100% anyway?
  Reply With Quote
Old 25-02-2004, 12:15   #12 (permalink)
Stickman
Dr. Lucien Sanchez
 
Stickman's Avatar
 
Join Date: Mar 2003
Location: UK
Posts: 5,642
Why will it all get buggered?

Transparent divs are usually the easiest way to do fiddly layouts. The lines, borders etc can be in a background gif and you just lay the content over the top.
  Reply With Quote
Old 25-02-2004, 12:34   #13 (permalink)
Brown
volkswagen yellow & gold
 
Brown's Avatar
 
Join Date: Apr 2003
Location: london, england.
Posts: 6,215
oooh poor fish, poor fish.

stick with it! (no pun intended stick boy)
  Reply With Quote
Old 25-02-2004, 14:32   #14 (permalink)
oli
Free Ring Ding™
 
oli's Avatar
 
Join Date: Feb 2003
Location: Manchester
Posts: 9,612
Quote:
Originally Posted by Stickman
Why will it all get buggered?

Transparent divs are usually the easiest way to do fiddly layouts. The lines, borders etc can be in a background gif and you just lay the content over the top.
I like that, never thought of it before
__________________
Linked In
..................
  Reply With Quote
Old 01-03-2004, 22:43   #15 (permalink)
Luke Redpath
Barney army!
 
Luke Redpath's Avatar
 
Join Date: Mar 2003
Location: London
Posts: 696
Quote:
Originally Posted by sleepingfish
That's what I'm afraid of having to resort to, but then if #content has too much text or images it will all get buggered. Why does the stupid client want it all to stretch 100% anyway?

Background image method really is the easiest. Make the page background the same as what you want the bottom (content) part to be, then tile horizontally a 100px high, 1px wide image the color of what you want the top div to be.
__________________
Luke Redpath .::. Software Engineer .::. Reevoo - Real Reviews From Real Customers
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8