Reply
100% height of an inner div
Old 03-01-2007, 12:35 AM 100% height of an inner div
johnncyber's Avatar
Extreme Talker

Posts: 216
I am trying to make a relatively easy fluid, 2 column layout, however I can not get the content column and the right column be 100% of the height of the container div.

Here is the simplified HTML (it is a Joomla Template)

Code:
<body>
<div id="container">
<div id="header">
  <img src="<? echo $GLOBALS[mosConfig_live_site]."/templates/".$GLOBALS[cur_template];?>/images/logo.png" alt="Young Professionals of Greater Lubbock"/>
</div><!-- end header -->
<div id="topMenu">
  <?php mosLoadModules ( 'topMenu' ); ?>
</div><!-- end topMenu -->
<div id="wrapper">
<!-- ============ Right Area ============ !-->
<div id="right">
  <?php mosLoadModules ( 'right' ); ?>
</div><!-- end right -->

<!-- ============ Content Area ============ !-->
<div id="content">
<?php include_once ("mainbody.php"); ?>
</div><!-- end content -->

</div><!-- end wrapper -->
<div id="footer">
<?php mosLoadModules ( 'footer' ); ?>
</div><!-- end footer -->

</div><!-- end container -->
</body>
Here is the Live Site: http://mark.eve-websolutions.com/
__________________
~Mark Romero
-Co Founder | Tech Guru, Studio [LBK]
-FireFox Advocate, GetFirefox.com
johnncyber is offline
Reply With Quote
View Public Profile Visit johnncyber's homepage!
 
When You Register, These Ads Go Away!
Old 03-03-2007, 04:59 AM Re: 100% height of an inner div
pitbull82's Avatar
Super Talker

Posts: 147
Name: Marcin Nabiałek
Location: Poland, Częstochowa
If I understand you well, I want to have to div columns to have exact height. There's no possibility to achieve it via CSS - solution is using image as the background which will imitate columns.

If you look at one of my sites: http://it.mnabialek.pl you will see 3 columns 100% height - but in fact they are not having exact size. I used http://it.mnabialek.pl/images/layout/tlo.gif to achieve such result.
__________________
Seo Link Directory | Kurs C++ | Forum C++
pitbull82 is offline
Reply With Quote
View Public Profile Visit pitbull82's homepage!
 
Old 03-03-2007, 05:43 AM Re: 100% height of an inner div
chrishirst's Avatar
Super Moderator

Posts: 13,609
Location: Blackpool. UK
unless you explicitly set the container height, the browser can't determine what 100% is equal to.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-04-2007, 02:20 PM Re: 100% height of an inner div
johnncyber's Avatar
Extreme Talker

Posts: 216
Quote:
Originally Posted by pitbull82 View Post
If I understand you well, I want to have to div columns to have exact height. There's no possibility to achieve it via CSS - solution is using image as the background which will imitate columns.

If you look at one of my sites: http://it.mnabialek.pl you will see 3 columns 100% height - but in fact they are not having exact size. I used http://it.mnabialek.pl/images/layout/tlo.gif to achieve such result.
The problem with that solution is that the columns are a fixed width. I am trying to make a 2 column fluid design.

chrishirst: I explicitly told the page height to be 100% and the container divs to also be 100%. From what I understand that should be enough to make an inner div height's 100%.
__________________
~Mark Romero
-Co Founder | Tech Guru, Studio [LBK]
-FireFox Advocate, GetFirefox.com
johnncyber is offline
Reply With Quote
View Public Profile Visit johnncyber's homepage!
 
Old 03-04-2007, 02:45 PM Re: 100% height of an inner div
pitbull82's Avatar
Super Talker

Posts: 147
Name: Marcin Nabiałek
Location: Poland, Częstochowa
If you have 2 fluid columns ther won't be any problem. You will only have to use background-position with %
__________________
Seo Link Directory | Kurs C++ | Forum C++
pitbull82 is offline
Reply With Quote
View Public Profile Visit pitbull82's homepage!
 
Old 03-04-2007, 11:00 PM Re: 100% height of an inner div
Experienced Talker

Posts: 30
Name: Ben Henick
As an addition to the mnabialek.pl demo, I put together the following:

http://www.henick.net/vignettes/columns.php

Hope it helps.
persist1 is offline
Reply With Quote
View Public Profile
 
Old 03-05-2007, 03:11 AM Re: 100% height of an inner div
chrishirst's Avatar
Super Moderator

Posts: 13,609
Location: Blackpool. UK
Quote:
I explicitly told the page height to be 100% and the container divs to also be 100%. From what I understand that should be enough to make an inner div height's 100%
Yep, sure but do you know what 100% of 100% means.
100% is not an explicit height, 600px would be an explicit height

the browser rendering engine doesn't know what the height of the body element will be (in pixels) until the page is fully rendered.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-06-2007, 10:24 AM Re: 100% height of an inner div
johnncyber's Avatar
Extreme Talker

Posts: 216
I fixed my problem. What I ended up doing is putting the background of the content div as the background of the body and then created a XX px column that stretched 100% of the body underneath the right nav. Thanks for all your help.
__________________
~Mark Romero
-Co Founder | Tech Guru, Studio [LBK]
-FireFox Advocate, GetFirefox.com
johnncyber is offline
Reply With Quote
View Public Profile Visit johnncyber's homepage!
 
Reply     « Reply to 100% height of an inner div
 

Thread Tools

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