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



Reply
Vertical stretch still not working (I read the links)
Old 06-28-2008, 08:22 PM Vertical stretch still not working (I read the links)
Novice Talker

Posts: 5
Trades: 0
OK I did research, I followed the links in this and other forums, and still I can;t get this to work.

I'm trying to make a three column layout for my site using divs; the nav to the left, content in the middle, and ads to the right. All three divs are inside a wrap div. I want the nav and ad div to stretch as far as the main content does, but after extensive research I'm still unable to get this to work. I set the height to 100% in all the containers, including html and body, and still the side divs only stretch up to a certain point, and do not reach the bottom.

Here's my code:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 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>Page</title>
 <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
 <script type="text/JavaScript">
  A script for the random ads. 
  </script>
 <style type="text/css">
 html, body { 
  height: 100%;
 }
 img { border: none; }
 h1 {text-align: center; }
 tr {vertical-align: up;}
 body {
  background-color: #808080; 
 }
 #wrap {
  width: 962px; 
  margin: 0 auto; 
  background-color: #FF6600; 
  text-align: middle; 
  height: 100%;
  min-height: 100%;
 }
 #nav {
  float: left; 
  width: 116px; 
  height: 100%; 
  min-height: 100%;
  background: url(halflifemenu2.jpg);
 }
 #main {
  link: #920000;
  vlink: #920000;
  text-align: left;
  text-color: white; 
  background: url(hlbg.JPG); 
  width: 685px; 
  float: left; 
  padding: 15px;
  height: 100%;
  min-height: 100%;
 }
 #right_bar {
  background: url(hlbg.JPG); 
  height: 100%;
 }
 </style>
</head>
 
<body>
 <div id="wrap">
 <div id="header">
  <map id="valvemap" name="valvemap"> 
  <area href="http://steampowered.com" alt="Steam" title="Steam" shape="rect" coords="0,0,130,51" />
  <area href="http://www.valvesoftware.com/" alt="Valve Software" title="Valve Software" shape="rect" coords="0,51,130,115" />
  </map>
  <img src="halflifelambda.JPG" alt="Half Life Symbol" /><img src="halflifelogo.JPG" alt="Half Life logo" /><img src="valvelogo.JPG" alt="Valve 
logo" usemap="#valvemap"/>
 </div>
 <div id="nav">
   <table border="1" width="112">
   <tr><td><a href="link.html"><b>Option1</b></a></td></tr>
   <tr><td><a href="link.html"><b>Option2 etc</b></a></td></tr>
   </table>
 </div>
 <div id="main">
   <h1>Heading</h1>
   blah blah text text<hr />
   <br />
   <table>
   <tr>
   <td>
    <img src="img.jpg" alt="alt" />
   </td>
   <td>
    blah blah text text
   <br />
   </td>
   </tr>
   <tr>
   <td>
    <img src="img.jpg" alt="alt" />
   </td>
   <td>
    blah blah text text. 
   </td>
   </tr>
   </table>
 </div>
 <div id="rightbar">
   <script type="text/JavaScript">
   showImage();
   </script>
 </div>
 </div>
</body>
</html>

Last edited by BlackRiven; 06-29-2008 at 11:38 AM..
BlackRiven is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-29-2008, 11:37 AM Re: Vertical stretch still not working (I read the links)
Novice Talker

Posts: 5
Trades: 0
Anyone? Please?
BlackRiven is offline
Reply With Quote
View Public Profile
 
Old 06-29-2008, 03:21 PM Re: Vertical stretch still not working (I read the links)
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
The easiest way is the "faux column" method: http://www.alistapart.com/articles/fauxcolumns/

Very, very simple, and avoids all of the complications of 100% here and there and everywhere.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 06-29-2008, 04:10 PM Re: Vertical stretch still not working (I read the links)
Novice Talker

Posts: 5
Trades: 0
Based on how difficult this turned out to be I'll probably resort to that, but it feels like a hack, and I'd like to know what the problem is, even if the problem is 'it can't be done'.
BlackRiven is offline
Reply With Quote
View Public Profile
 
Old 06-29-2008, 07:16 PM Re: Vertical stretch still not working (I read the links)
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
The faux columns method is NOT a hack, it's a perfectly viable and quite reliable method.

Dump the tables, you shouldn't use them for layout.
When you use floats you MUST CLEAR the floats or nothing will stretch properly.

There are javascript solutions, but that to me is more of a 'hack' than the faux columns method, which is more of an illusion than a hack.
__________________
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
Reply With Quote
View Public Profile
 
Reply     « Reply to Vertical stretch still not working (I read the links)
 

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.63375 seconds with 12 queries