Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Closed Thread
Old 11-09-2007, 08:45 PM Always vAlign Bottom
Extreme Talker

Posts: 196
Trades: 0
Basically, I'm trying to get a div *bottom* to stick to the bottom of the page always, regardless if div *content* has enough data to push it down. Simple right? But it also needs to be able to align below the page just below *content* if the page needs to scroll, so it can't be aligned "absolutely". So how's it done?

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled Document</title>
<style type="text/css" title="">
#sidebar {
    background-color: #00CC00;
    float: left;
    height: 100%;
    width: 250px;
}
#content {
    background-color: #FF66FF;
    float: left;
    height: 100%;
    width: 600px;
}
#bottom {
    background-color: #CCCCCC;
    clear: both;
    width: 500px;
    bottom: 0px;
}

</style>
</head>

<body>

<div id="sidebar">Sidebar</div>

<div id="content">
  <p>Main Content Area </p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
 
</div>

<div id="bottom">Bottom Nav Div - this page is layingout correctly. </div>

</body>
</html>
empiresolutions is offline
View Public Profile
 
 
Register now for full access!
Old 11-10-2007, 07:27 AM Re: Always vAlign Bottom
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
It can't be done using CSS alone.
You would need to use scripting to check if the content height is less than the browser viewport height and set the div style or classname to suit.

BTW. Changing the class name is quicker than setting style properties.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
View Public Profile Visit chrishirst's homepage!
 
Old 11-10-2007, 12:30 PM Re: Always vAlign Bottom
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
this might work http://www.themaninblue.com/writing/...ve/2005/08/29/
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
View Public Profile
 
Old 11-12-2007, 06:23 AM Re: Always vAlign Bottom
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Decided this was a good candidate for one of my occasional DHTML scripting "articles"

"Floating" or "Sticky" Footer?

Write up not quite complete BTW
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
View Public Profile Visit chrishirst's homepage!
 
Old 11-14-2007, 04:05 AM Re: Always vAlign Bottom
Extreme Talker

Posts: 196
Trades: 0
Thanks for all the help. These links seem to provide similar ways to do what I'm looking for.

http://scott.sauyet.com/CSS/Demo/FooterDemo1.html

http://ryanfait.com/sticky-footer/

http://www.themaninblue.com/writing/...ve/2005/08/29/
empiresolutions is offline
View Public Profile
 
Closed Thread     « Reply to Always vAlign Bottom
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15532 seconds with 12 queries