100% height

This is a discussion on "100% height" within the Web Page Design section. This forum, and the thread "100% height 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 Mar 28th, 2008, 09:02
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to RZX Developer
100% height

Hey all,

I am currently messing about with css height att and I am doing a 2 column layout and want both columns to be 100% height within the browser but all I am getting is the height of the content.

Could you please look at my code and let me know what I am doing wrong.

At this moment in time my page is not live.

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
    <head>

        <title>test</title>

        <style>

body{        
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    margin: 0px auto;
    padding: 0px;
    color: #000000;
    background: #ffffff;
}

#body {
    width: 1500px;
    height: 100%;
    margin: 0px 0px 0px 0px;
    padding: 0px;
    background: #232323;
}

#left {
    width: 450px;
    height: 100%;
    background: #ff0000;
}

#right {
    width: 1050px;
    height: 100%;
}

        </style>

    </head>

<body>

    <div id="body">

        <div id="left">
        &nbsp;
        </div>

        <div id="right">
        &nbsp;
        </div>
        
    </div>

</body>
</html>
Wayne

Last edited by Aso; Mar 28th, 2008 at 14:34.
Reply With Quote

  #2 (permalink)  
Old Mar 28th, 2008, 09:17
Ed Ed is offline
Highly Reputable Member
Join Date: Jul 2007
Location: Cork, Ireland
Posts: 687
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: 100% height

Could we have a link? I can't see why it would not be working Wayne. Also, you might like to try the property min-height as setting a definite height on columns could cause a lot of restrictions and limit content levels.

Ed.
Last Blog Entry: Happy New Year! (Dec 31st, 2007)
Reply With Quote
  #3 (permalink)  
Old Mar 28th, 2008, 09:48
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to RZX Developer
Re: 100% height

There is no link available as I don't currently have my domain details with me and I am working on a work pc. I have just tried the min-height: 100% and still no luck.
Reply With Quote
  #4 (permalink)  
Old Mar 28th, 2008, 11:05
Aso's Avatar
Aso Aso is offline
Chief Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,004
Blog Entries: 2
Thanks: 5
Thanked 23 Times in 20 Posts
Send a message via Skype™ to Aso
Re: 100% height

You most likely need;
Code: Select all
body {
height: 100%;
}
Otherwise, browsers set the <body> height to auto, so the <div>'s only expand what's needed.

Note: If the above does not work, try adding html to the same declaration.
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Reply With Quote
  #5 (permalink)  
Old Mar 28th, 2008, 12:37
Junior Member
Join Date: Jan 2008
Location: Eastern Canada
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Re: 100% height

I believe I'm having the same issue. Adding height:100% to the body didn't fix it, nor did min height.

My site's layout is liquid so I'm wanting the right colum to adjust with the amount of content in the mainContent area so it always reaches the footer.

I can set it to a specific static hight with height: ## px: and it does change but isn't giving the desired effect.

I tried giving the right column the property height:100% but that didnt' do it.

Here's the site

http://www.hspfan.com/index.htm

Here's the css

http://www.hspfan.com/hspstyle1.css

I'm guessing it has to do with another property not allowing the column to use the height 100% property.

Maybe I'm way off.

Any ideas? It seems we're having the same problem.

Last edited by UUDDLRLRBA; Mar 28th, 2008 at 12:40.
Reply With Quote
  #6 (permalink)  
Old Mar 28th, 2008, 13:09
Reputable Member
Join Date: Jul 2007
Location: UK, Essex
Age: 21
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to RZX Developer
Re: 100% height

I have looked google and all I am getting back in the height/min-height but like yourself it is not working, if I find the solution I'll post it.
Reply With Quote
  #7 (permalink)  
Old Mar 28th, 2008, 18:06
Junior Member
Join Date: Jan 2008
Location: Eastern Canada
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Re: 100% height

I'm going to try n rebuild the layout using this template.

http://matthewjamestaylor.com/blog/u...enu-pixels.htm
Reply With Quote
  #8 (permalink)  
Old Mar 28th, 2008, 19:41
frinkky's Avatar
Design Admin
Join Date: Oct 2006
Location: Southampton
Age: 30
Posts: 271
Blog Entries: 2
Thanks: 2
Thanked 2 Times in 2 Posts
Send a message via MSN to frinkky Send a message via Skype™ to frinkky
Re: 100% height

Try

Code: Select all
html, body {
height:100%;
}
IE 6 doesn't tend to need the html element to be set 100% but including it won't hurt.
Last Blog Entry: Fobriwap! (Mar 10th, 2008)
Reply With Quote
  #9 (permalink)  
Old Mar 28th, 2008, 21:59
Junior Member
Join Date: Jan 2008
Location: Eastern Canada
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Re: 100% height

I'll try in when I get home.
Reply With Quote
  #10 (permalink)  
Old Mar 29th, 2008, 08:02
Junior Member
Join Date: Jan 2008
Location: Eastern Canada
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Re: 100% height

That had some pretty bad effects on the site. Everything went center and the container disappeared.

Strange
Reply With Quote
  #11 (permalink)  
Old Mar 29th, 2008, 09:02
Junior Member
Join Date: Jan 2008
Location: Eastern Canada
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Re: 100% height

What it appears to be is there's no way to have a liquid table with a column that will always reach the bottom, unless the column is full and is also liquid. Wish there was a way to accomplish this but it looks like I'm going to have to go static.....now comes the choice to optimize for 800 or 1024.
Reply With Quote
  #12 (permalink)  
Old Mar 29th, 2008, 10:23
frinkky's Avatar
Design Admin
Join Date: Oct 2006
Location: Southampton
Age: 30
Posts: 271
Blog Entries: 2
Thanks: 2
Thanked 2 Times in 2 Posts
Send a message via MSN to frinkky Send a message via Skype™ to frinkky
Re: 100% height

Try this

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
    <div id="wrapper">

        <div id="left">
        Left
        </div>

        <div id="right">
        Right
        </div>
        <div id="clearfloats"></div>
    </div>

</body>
</html>
Code: Select all
html, body {
margin:0;
padding:0;
height:100%;
}

body{        
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #000000;
    background: #ffffff;
}

#wrapper {
    width: 100%;
    height: 100%;
    background: #232323;
}

#left {
    width: 30%;
    height: 100%;
    float:left;
    background: #ff0000;
}

#right {
    width: 70%;
    height: 100%;
    float:right;
    background:#0000ff;
}

#clearfloats {
clear:both;
}
Last Blog Entry: Fobriwap! (Mar 10th, 2008)
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
CSS Div height problem dryjoy Web Page Design 1 Jan 6th, 2008 18:05
How to make a table height equal to the browser height ? subhadip Starting Out 4 Sep 20th, 2007 07:56
CSS #frame height and PHP SCDWB Web Page Design 6 May 12th, 2007 22:45
100% div height jimz JavaScript Forum 2 Mar 22nd, 2006 00:53


All times are GMT. The time now is 08:32.


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