Advanced Web Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Iron Speed
 
Go Back   Dev Articles Community ForumsWeb DesignAdvanced Web Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old November 5th, 2003, 05:31 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
CSS/XHTML - Height Issue

Hi campers,

I have a problem. I'm building a new site using a totally table-less design, using only XHTML & CSS. I've hit a snag - I'm trying to get the main content area (where the copy goes) to have a height of 100% (so that it's backguond color goes all the way down to the bottom of the page). The height attribute looks like it is being ignored. Has anyone else had a problem like this before?

EDIT March 26, 2004 - Site has been moved from dev server to the live server

Reply With Quote
  #2  
Old November 5th, 2003, 05:50 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
I'm curious to find out as well... I've run into some sites where they simply pad a bunch of break tags until the body reaches the equivalent height of the rest of the page... I'm sure there has to be a cleaner method.
__________________
____________________________________________
Developer Shed Weekly Writer | DevArticles Forum Moderator
Build Your Own KlipFolio Klip With PHP
FrankManno.com - Under Construction
Design Interactive Group - Under Construction

Reply With Quote
  #3  
Old November 5th, 2003, 09:28 PM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to avit
Hey stumpy,

Try adding a 999px height to your #container and see what happens... it's kind of telling and I think it should help you figure out a solution. (Compare before and after...)

I'm wondering if you should have a separate div for the header?

Sorry I don't have time to dig deeper and give you a silver bullet solution right now.

Reply With Quote
  #4  
Old November 5th, 2003, 09:55 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Hey avit - thanks for your input. I have tried that, and yes, it does work, but, it's not ideal... i.e. What if the site was dynamic, e.g. content was loaded in from a DB.

I've been racking my brain for ages (as has FrankieShakes) over this one, and the only solution we can come up with is to explicitly set the container height (the same as you suggested), which to me feels like a dirty hack. In this case, the site is static, so this solution is feasible, but what about dynamic sites?

As for the header - yeah, it prolly is more "correct" to have it in a separate DIV. Will this have any effect on the height issue though?

P.S. What browser/ver are you using?

Reply With Quote
  #5  
Old November 5th, 2003, 11:50 PM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to avit
Quote:
Originally posted by stumpy
As for the header - yeah, it prolly is more "correct" to have it in a separate DIV. Will this have any effect on the height issue though?

P.S. What browser/ver are you using?


I'm using Safari.

Well, you have a white background for #container, which only appears behind the header, and the menu and content appear to "hang" out the bottom of it. They aren't actually "inside" that div, so hacking it right could get difficult. I would rename your #container to #header, and make a second div for your content. Make it the same, but change background: none; margin-top: -20px so it overlaps as you have it now. That way your LHcol and mainbody could actually be contained within their div. See attached file.

I have a hack that sort of works. Also in the attached files. Another way to do this would be with absolute positioning (probably better and easier). Also have a look at the layout demos on http://www.positioniseverything.net/ for more ideas.

Reply With Quote
  #6  
Old November 5th, 2003, 11:54 PM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to avit
Here's the attached file.

It's actually a tgz file (tar-gzip), so rename and use as appropriate.
Attached Files
File Type: zip janejose.zip (1.4 KB, 911 views)

Reply With Quote
  #7  
Old November 6th, 2003, 05:27 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Ack - Safari. I was hoping you wouldn't say that

btw - positioniseverything.net rocks. Already been through that site with a fine tooth comb.

Reply With Quote
  #8  
Old November 6th, 2003, 02:50 PM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to avit
Yep, that's what it looks like... Strange, I always thought Safari to be on the ball with its CSS rendering. Ignore almost everything I said. I'll have another look at it later if I find the time.

Reply With Quote
  #9  
Old November 6th, 2003, 05:54 PM
FrankieShakes FrankieShakes is offline
Frank The Tank!
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,246 FrankieShakes User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to FrankieShakes Send a message via MSN to FrankieShakes
Yeah, that's weird... Usually Safari is on the ball... Is it an older version, avit?

Btw, Stumpy... Where'd you get access to the Mac? NICE!!

Reply With Quote
  #10  
Old November 6th, 2003, 06:02 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Safari probably IS correct - I've mostly likely made some horrible, ugly error!

I'm getting to the point where I'm going to re-write this thing using my beloved tables. It'll be soooo simple.

Reply With Quote
  #11  
Old November 7th, 2003, 01:03 AM
CHornJr's Avatar
CHornJr CHornJr is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: New York City
Posts: 233 CHornJr User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 50 m 19 sec
Reputation Power: 6
Send a message via AIM to CHornJr Send a message via MSN to CHornJr Send a message via Yahoo to CHornJr
Tables, yuck
***Shivers at the thought of using tables for design**

The truth is, what ever works for you and your audience is what is best
__________________
CHornJr
"One day I'll know what I am doing"
My Blog
Suanhacky Lodge #49
Rebel Squadrons

Reply With Quote
  #12  
Old November 7th, 2003, 01:18 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
CHornJr - if you can solve the problem at hand, them maybe I'll agree with you. As yet, no-one from this board can do it. Additionally, I don't really find having to include dozens of hacks in my CSS to get around various browser issues, convenient or enjoyable.

Reply With Quote
  #13  
Old November 7th, 2003, 03:06 AM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via ICQ to avit
Quote:
Originally posted by stumpy
Additionally, I don't really find having to include dozens of hacks in my CSS to get around various browser issues, convenient or enjoyable.


You said it. Might as well be using spacer GIFs and all those rowspan/colspan hacks from HTML 3.2 for all it's worth.

Hacks are not the point of using XHTML and CSS.

There is a min-height property in the CSS2 box model, but it's not widely supported, unfortunately.

Reply With Quote
  #14  
Old November 7th, 2003, 08:51 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Well, I've done it!

It's got a little hack or two in there, but it's working (in IE anyway - I dread to think what it looks like in Safari )

I separated the header from the content. The nav and copy are sitting in a container with the bkg color set to the bkg color that you see under the nav. This way, if the copy is long, the bkg color will stretch.

Conversly, if the copy was short, the nav bkg color would appear underneath copy, so to get around that, I just added some '<br />'s to the copy. I feel so dirty. Anyway, it's done. It went waaay over the time I allocated, but I learned a lot.

Check out the final site

Reply With Quote
  #15  
Old November 10th, 2003, 07:55 PM
INF INF is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Location: Woodland, WA
Posts: 26 INF User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Nice design! Looks good in IE, but slightly different in Mozilla (Firebird).
Just a note about content creeping out of divs.
I've found if you place a "spacer" div (with the property "clear:both;") to break out of the floats, content will then stay inside it's container.

Reply With Quote
  #16  
Old November 11th, 2003, 06:29 AM
kguck kguck is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 1 kguck User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
box tutorials

Hi the noodle incident

URL

has probably the most comprehensive box tutorials and examples, this is where I got to grips with the issues being discussed you wont be dissapointed
Cheers Kieran

Reply With Quote
  #17