CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 25th, 2003, 01:36 PM
bmacfarland bmacfarland is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 4 bmacfarland User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Help with css positioning and footers

I have a two column layout (a navigation element and a content area), that requires a footer at the bottom of the longer column. The content column can sometimes be shorter be than navigation and vice versa depending on the page (it's data driven).

I've read at places like A List Apart (URL) that this is fairly impossible without using float left and float right (which I don't have much experience using). I hope to not use some sort of javascript hack that is there.

I really only require it to work in current Gecko-based or IE browsers. Opera would be a nice bonus.
Comments on this post
arionic agrees!

Reply With Quote
  #2  
Old March 25th, 2003, 01:48 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,817 jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 7 h 14 m 56 sec
Reputation Power: 1098
See if this is what you're going for (copy, paste, view).
Code:
<!DOCTYPE html
	PUBLIC "-//W3C//DTD XHTML 4.01 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>Can I put my BAR in your FOO?</title>
</head>

<body>
<div style="float:left">Navigation</div>
<div style="float:left">This<br />That<br />The<br />Other</div>
<div style="clear:both;float:left">Nav Foot</div>
</body>

</html>

Reply With Quote
  #3  
Old March 25th, 2003, 03:13 PM
bmacfarland bmacfarland is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 4 bmacfarland User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I was trying to do it without floats as I have about 3-4 days of work into going with relative and absolute positioning andn a float left really distorts everything that's inside of the columns (yeah, I have divs nested in divs, nested in more and more divs). Is there a way to get absolute and relative positioning to work inside those divs (it seems like the float:left, is being inherited in child divs)?



<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 4.01 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
<title>Can I put my BAR in your FOO?</title>
</head>

<body style="background-color:blue;">
<div style="background-color:white">
<div style="float:left">Navigation</div>
<div style="float:left">This<br />That<br />The<br />Other</div>
<div style="clear:both;float:left">Nav Foot</div>
</div>
</body>

</html>

Reply With Quote
  #4  
Old March 25th, 2003, 03:25 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,817 jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 7 h 14 m 56 sec
Reputation Power: 1098
Well you didn't mention that you didn't want to use float, only that you didn't want to hack it with JavaScript -- oh well.

You should be able to do it in your situation without floats by closing your main containing div before you add the footer one. divs stack on top of each other by default (when not told to do anything else).
Code:
<div>Foo</div><div>Bar</div>

// results in

Foo
Bar
So if you put all of your nested divs inside the div containing Foo above, and position them all like you already have, adding another div after that that contains the Nav Footer should put it at the bottom.
Code:
<div>
<!-- this div's height equals the height of Nav or Content, whichever is higher -->
  <div>Nav</div>
  <div>Content</div>
</div>
<div>NavFooter</div>

Reply With Quote
  #5  
Old March 25th, 2003, 04:12 PM
bmacfarland bmacfarland is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 4 bmacfarland User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
That last snippet didn't seem to put the nav and content into columns, they were layered on top of each other. When I do try to put in columns, this is what I'm getting.

<html>
<head>
<title>Can I put my BAR in your FOO?</title>
</head>
<body style="background-color:blue;">

<div style="background-color:red">header</div>
<div style="background-color:yellow">
<div style="position:absolute;width:16%;">
Nav<br> this<br> is<br> very<br> big<br>
</div>
<div style="position:relative;top:0;left:16%;width:83%;">
Content<br>is<br>small<br> <!-- or<br>is<br>it?<br> -->
</div>
</div>
<div>NavFooter</div>
</body>
</html>

At this point is seems to put the footer at the end of the content area which isn't what want unless the content area is bigger than the navigation. I know I could tie it to the height of the navigation, but then it would break if lots of content were to be sent. Perhaps I'm making it more complicated than it should be?

Last edited by bmacfarland : March 25th, 2003 at 04:14 PM.

Reply With Quote
  #6  
Old March 25th, 2003, 04:32 PM
jharnois's Avatar
jharnois jharnois is offline
mod_dev_shed
Dev Shed God 20th Plane (14500 - 14999 posts)
 
Join Date: Sep 2002
Location: Atlanta, GA
Posts: 14,817 jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level)jharnois User rank is General 2nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 1 Week 4 Days 7 h 14 m 56 sec
Reputation Power: 1098
My last code example was meant to show you where to place the Nav Footer in relation to the parent <div>s through your site. It wasn't mean to be a paste and work thing.

I know you said you'd prefer not to float, but to get two divs to be next to each other when you don't know the height of the first one, it's the only way I know.
Code:
<html>
<head>
<title>Can I put my BAR in your FOO?</title>
</head>
<body style="background-color:blue;">
<div style="background-color:red">header</div>
<div style="background-color:yellow;width:100%;">
  <div style="float:left;width:16%;">Nav<br> this<br> is<br> very<br> big<br></div>
  <div style="float:left;width:83%;">Content<br>is<br>small<br> <!-- or<br>is<br>it?<br> --></div>
</div>
<div style="clear:both">NavFooter</div>
</body>
</html>
Honestly, it's easier than dealing with "position" all the time and trying to get all of that to work.

Reply With Quote
  #7  
Old March 25th, 2003, 05:37 PM
bmacfarland bmacfarland is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2003
Posts: 4 bmacfarland User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
That's actually great in IE, but...

... the colors don't show up the same in Mozilla. I think I found a workaround of adding "float:left" to the yellow div there. I'm going to give this some work and see how it goes. If it doesn't, at least I'll learn a bit more about float.

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Help with css positioning and footers

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap