Reply
Simple DIV and CSS Layout help.
Old 06-27-2005, 07:34 AM Simple DIV and CSS Layout help.
Unknown.

Posts: 1,693
Trades: 0
For a while now i've been creating all my layouts using DIVs and CSS instead of tables.. Although I've only ever had one main problem which I can't solve - this being it.

What I want to be able to do is have two DIVs next to each other, like in the image below, one for the main the content and the other for the navigation.. like the sidebar to the right on this site.

I've tried using absolute posistioning but then the problem is the nav and main area have to be set at a certain height and then use overflow, which adds the scrollbars to these areas, to be able to display the footer DIV underneath.. maybe theres a way around this I dont know?

So Basically what I want to be able to do is have it so the main content and navigation DIV can be any height.. depending on whats inside of them.. and then the footer DIV is always displayed at the bottom. So the footer always remains at the bottom regardless of which DIV, main or nav, is larger. Like in the examples below.

I know this could easily be achieved using tables.. but I would rather do it using simple just CSS.

Hope this makes sense.. this would off a GREAT help if I can finally understand this.

Thanks in advance.
Dark-Skys99 is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 06-27-2005, 09:29 AM
techwench's Avatar
Code Monkey

Posts: 1,452
Name: Danalyn
Location: Dallas, TX
Trades: 0
Add this to your footer div css:

Code:
  clear: both;
__________________
personal | portfolio
techwench is offline
Reply With Quote
View Public Profile
 
Old 06-27-2005, 09:40 AM
danburzo's Avatar
Skilled Talker

Posts: 82
Location: Bistrita RO
Trades: 0
or have something like this:
Code:
<div id="page">
   <div id="header">...</div>
   <div id="content">
      <div id="main">...</div>
      <div id="nav">...</div>
      <div style="clear:both">&nbsp;</div>
   </div>
   <div id="footer">...</div>
</div>

Last edited by danburzo; 06-27-2005 at 09:42 AM..
danburzo is offline
Reply With Quote
View Public Profile
 
Old 06-27-2005, 03:22 PM
Unknown.

Posts: 1,693
Trades: 0
Thanks! Easier than I thought!
Dark-Skys99 is offline
Reply With Quote
View Public Profile
 
Old 07-04-2005, 06:48 AM
Skorch1's Avatar
Super Talker

Posts: 115
Location: California
Trades: 0
You could always P tag in the php include at the bottom of your content div( I assume that this is the one that is all different sizes)
__________________
Check out my Cliff Diving website!
Skorch1 is offline
Reply With Quote
View Public Profile Visit Skorch1's homepage!
 
Old 08-05-2006, 05:08 PM Re: Simple DIV and CSS Layout help.
Junior Talker

Posts: 1
Trades: 0
Hey
Try working with this template layout at 2 Column Layout

It is one of a few layouts from an article at AlanWho - 7 CSS XHTML 1.1 Layouts

Hope this helps.

Peace.
thevdo is offline
Reply With Quote
View Public Profile
 
Old 08-08-2006, 04:39 PM Re: Simple DIV and CSS Layout help.
LadynRed's Avatar
Super Moderator

Posts: 9,392
Location: Tennessee
Trades: 0
Take a look at the code at Primary Health Group - Johnston Willis, you'll see how to do what you want. In that site the nav is on the left, easy enough to switch. You'll also see the one of the ways to clear a float (no non-breaking spaces necessary).
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Simple DIV and CSS Layout help.
 

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.10413 seconds with 13 queries