100% height minus header

This is a discussion on "100% height minus header" within the Web Page Design section. This forum, and the thread "100% height minus header are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Oct 27th, 2007, 11:43
New Member
Join Date: Jun 2007
Location: U.K.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
100% height minus header

Hi! Basically i am trying to create a layout where the main content is 100% height of the page minus a fixed size header.

I have received some great help and have came to this

http://tinyurl.com/3dkeuh - html
http://tinyurl.com/2nq868 - css

The page looks perfect in ie 6 but in other browsers such as ie 7, firefox and safari the frames that hold the content and nav are only small in size, i want to replicate the ie 6 results and get the frames to stretch the full height of the page.

I am certain this is a CSS error and any help on the matter would be greatly appreciated!

Thanks,
-Exodus
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Oct 27th, 2007, 11:49
Reputable Member
Join Date: Apr 2007
Location: Scotland
Age: 17
Posts: 233
Thanks: 0
Thanked 0 Times in 0 Posts
Re: 100% height minus header

Code: Select all
iframe {
 height: 100%;
}
Try that in your CSS.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Oct 27th, 2007, 19:58
New Member
Join Date: Jun 2007
Location: U.K.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re: 100% height minus header

That dosen't seem to have changed anything. Any other ideas?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Oct 27th, 2007, 20:47
Reputable Member
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: 100% height minus header

change css to this.

HTML: Select all
#content {
 float: right;
 height: 420px;
 width: 75%;
}
#nav {
 height: 420px;
 width: 20%;
}
just adjust 420px until it looks ok.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Oct 27th, 2007, 20:52
New Member
Join Date: Jun 2007
Location: U.K.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re: 100% height minus header

That would be okay except i am trying to keep the layout as fluid as possible

If i set the height of the frames to a fixed size, i.e. around 420px as you suggested, it would look fine in some resolutions and appear to fill the remainder of the page but in other resolutions the user may need to scroll to see the entire page which is not what i want.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Oct 27th, 2007, 22:27
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: 100% height minus header

Haven't look at the code but instead of the 420px suggestion that was made, how about a height of 80% or whatever gives you the perfect height? 88%???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Oct 27th, 2007, 23:01
Reputable Member
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: 100% height minus header

it is looking unlikely that you can set the iframe height to 100% for firefox
ive been googling for about 1hr and I think the only way to do this is with javascript.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Oct 28th, 2007, 07:41
Marc's Avatar
Staff Manager

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Posts: 1,780
Thanks: 0
Thanked 16 Times in 16 Posts
Re: 100% height minus header

What you will need to do is set the body a width of 100%... Once you've done this, change the content area to suit.
__________________
Marc
Staff Manager - Webforumz.com


Want to be a moderator? PM me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Oct 28th, 2007, 07:45
Marc's Avatar
Staff Manager

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Posts: 1,780
Thanks: 0
Thanked 16 Times in 16 Posts
Re: 100% height minus header

After looking at your code and trying to make the iframes the proper size... It wouldnt work. Do you really need to use iframes?

Ill keep playing and get back to you.
__________________
Marc
Staff Manager - Webforumz.com


Want to be a moderator? PM me.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Oct 28th, 2007, 08:43
New Member
Join Date: Jun 2007
Location: U.K.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Re: 100% height minus header

i dont really need to use frames but i do want to.

i think i should abandon using frames because everyone i ask seems to advise me to do that and they seem to be causing all the problems.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Oct 28th, 2007, 09:28
Reputable Member
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: 100% height minus header

there is a javascript I found on the net.

HTML: Select all
<script language="JavaScript">
<!--
function resize_iframe()
{

    var height=window.innerWidth;//Firefox
    if (document.body.clientHeight)
    {
        height=document.body.clientHeight;//IE
    }
    //resize the iframe according to the size of the
    //window (all these should be on the same line)
    document.getElementById("glu").style.height=parseInt(height-document.getElementById("glu").offsetTop-8)+"px";
    
}

// this will resize the iframe every
// time you change the size of the window.
window.onresize=resize_iframe; 

//Instead of using this you can use: 
//    <BODY onresize="resize_iframe()">


//-->
</script>
add this to your iframe.

HTML: Select all
<iframe src="main.php" width="75%" height="100%" id="glu" onload="resize_iframe()"  scrolling="auto"></iframe>
It seems to work but only if you resize the window.
Maybe it can be tweaked by someone who knows about javascript.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make a table height equal to the browser height ? subhadip Starting Out 4 Sep 20th, 2007 07:56
php header ( need help) csun PHP Forum 2 Mar 18th, 2007 23:46
Header Help eulB Graphics and 3D 5 Jun 12th, 2006 22:21
Please help, I need a new header(s) mizbuffie Graphics and 3D 2 May 22nd, 2006 04:04


All times are GMT. The time now is 01:47.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42