Jump to content


100% Height in CSS


11 replies to this topic

#1 Devilman

    Young Padawan

  • Members
  • Pip
  • 24 posts

Posted 01 October 2006 - 05:45 PM

I thought that it wasn't working but realised that was because it works in internet explorer is there a way to make it work in firefox? Firefox only extends the div as long as the content inside it.

#2 coolaid

    P2L Jedi Master

  • Members
  • PipPipPipPip
  • 1,435 posts
  • Gender:Male
  • Interests:i wonder..

Posted 01 October 2006 - 06:36 PM

lets see an example, you said ie does it, so i'm guessing you used floats without clears. but in reality css doesn't support 100% height

#3 Devilman

    Young Padawan

  • Members
  • Pip
  • 24 posts

Posted 02 October 2006 - 05:29 AM

It's exactly how I want my site to look which is the annoying thing without the sidenavs stretching down 100% it makes the site go out of proportion.

#4 Devilman

    Young Padawan

  • Members
  • Pip
  • 24 posts

Posted 02 October 2006 - 10:22 AM

http://www.whos-blazin.org/test.php there is the link to the page as you can see it works ok in internet explorer but the heights don't work in firefox. I know the coding is a bit sloppy but it's a first attempt using CSS and I am working on fixing any sloppyness.

#5 Devilman

    Young Padawan

  • Members
  • Pip
  • 24 posts

Posted 02 October 2006 - 06:12 PM

Or if anyone can think of any other way to fix it please help? I don't want to make the site a certain height because I'm going to use includes so the content will sometimes be long.

#6 Davey

    P2L Jedi

  • Members
  • PipPipPip
  • 620 posts
  • Location:Perth, Scotland
  • Interests:Creativity, Adrenaline, Etc

Posted 03 October 2006 - 03:04 AM

View PostDevilman, on Oct 3 2006, 12:11 AM, said:

Or if anyone can think of any other way to fix it please help? I don't want to make the site a certain height because I'm going to use includes so the content will sometimes be long.


i too have had this issue... i dont believe there is a way u can have it to work in FF as yet - i ended up just using height:auto; and letting the layout size itself to the content... it bugged me but i found no immediate fixes after trying on numerous web design forums

#7 Devilman

    Young Padawan

  • Members
  • Pip
  • 24 posts

Posted 03 October 2006 - 06:45 AM

It really is quite annoying I thought maybe it's because height 100% wasn't valid CSS coding but I went and validated my CSS and it came out error free.

#8 greg

    Jedi In Training

  • Members
  • PipPip
  • 499 posts
  • Location:New York City
  • Interests:Fine art, web and graphic design, naval architecture, chess, and sports.

Posted 04 October 2006 - 12:14 PM

There's no way around it without using Javascript.

Either use a background image to give the appearance of a fully-stretched box, or just let the content do the stretching.

#9 Devilman

    Young Padawan

  • Members
  • Pip
  • 24 posts

Posted 04 October 2006 - 06:00 PM

Thats what I done put the main content and sidenav in a container with a background image. Therefore the sidenav will appear to stretch to the length of the main content and visa-versa.

#10 Adαm

    Young Padawan

  • Members
  • Pip
  • 189 posts
  • Gender:Male
  • Location:United Kingdom

Posted 06 October 2006 - 01:05 PM

Add this to the css, it will hopefuly fix it:
html {
height: 100%;
}
body {
height: 100%;
}


#11 NGPixel

    Senior Programmer

  • P2L Staff
  • PipPipPipPip
  • 1,410 posts
  • Gender:Male
  • Location:Montreal, Canada
  • Interests:Web Design : Coding : Animation

Posted 06 October 2006 - 02:34 PM

As Devilman, CSS does not support 100% height. The problem is not CSS but they way your page was coded. You need to use a container div (look P2L source code if you need an example).

#12 Devilman

    Young Padawan

  • Members
  • Pip
  • 24 posts

Posted 07 October 2006 - 06:00 PM

Thats what I done in the end used a container with a background image therefore the main content divs stretch to the height of the container which is going to be the the same length as the highest div.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users