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.



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

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
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
Reply With Quote

  #2 (permalink)  
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
Send a message via MSN to Blake121
Re: 100% height minus header

Code: Select all
iframe {
 height: 100%;
}
Try that in your CSS.
Reply With Quote
  #3 (permalink)  
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?
Reply With Quote
  #4 (permalink)  
Old Oct 27th, 2007, 20:47
SuperMember

SuperMember
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.
Reply With Quote
  #5 (permalink)  
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.
Reply With Quote
  #6 (permalink)  
Old Oct 27th, 2007, 22:27
SuperMember

SuperMember
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%???
Reply With Quote
  #7 (permalink)  
Old Oct 27th, 2007, 23:01
SuperMember

SuperMember
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.
Reply With Quote
  #8 (permalink)  
Old Oct 28th, 2007, 07:41
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,636
Thanks: 0
Thanked 6 Times in 6 Posts
Send a message via MSN to Marc Send a message via Skype™ to Marc
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.
Reply With Quote
  #9 (permalink)  
Old Oct 28th, 2007, 07:45
Marc's Avatar
Moderator

SuperMember
Join Date: Apr 2007
Location: Scotland, UK
Age: 15
Posts: 1,636
Thanks: 0
Thanked 6 Times in 6 Posts
Send a message via MSN to Marc Send a message via Skype™ to Marc
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.
Reply With Quote
  #10 (permalink)  
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.
Reply With Quote
  #11 (permalink)  
Old Oct 28th, 2007, 09:28
SuperMember

SuperMember
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.
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 04:25.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs 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 43