PDA

View Full Version : General HTML/CSS height question?



frostBite
June 28th, 2009, 03:35 AM
When setting " height:100%; " the height only goes to the bottom of the code/images not the bottom of the page (in IE and doesn't stretch all the way to bottom in Firefox either).

How can I make my height truly stretch to the bottom of the page, regardless of how many images/code is there and what the page zoom is at?

Thank you,
frostBite

Templarian
June 28th, 2009, 10:56 AM
html, body
{
padding: 0;
margin: 0;
height: 100%;
}

a tadster
June 28th, 2009, 08:25 PM
or to cover every option :


html, body {margin:0%;margin-top:0%;margin-bottom:0%;margin-left:0%;margin-right:0%;padding:0;}

simplistik
June 29th, 2009, 12:26 AM
or to cover every option :


html, body {margin:0%;margin-top:0%;margin-bottom:0%;margin-left:0%;margin-right:0%;padding:0;}



margin: 0; and
padding: 0; cover every option ...

nykoelle
June 29th, 2009, 11:04 AM
* { margin: 0; padding: 0; }


then manually set your margins and paddings where needed (p, h1, etc).

I also put min-height on everything. I forget why... there was a reason once for it. : shrug :

a tadster
June 29th, 2009, 11:15 AM
simplistick, that actually does not cover every option for every browser (FireFox) and it also wants %'s.

Templarian
June 29th, 2009, 11:45 AM
simplistick, that actually does not cover every option for every browser (FireFox) and it also wants %'s.
0 = 0% odd enough.

What nykoelle suggested is generally done, but wasn't asked for in the question, and would probably cause him more frustration.

tad, your still kind of new to this, might want to be careful answering questions, it can confuse some of the members

simplistik
June 29th, 2009, 02:23 PM
simplistick, that actually does not cover every option for every browser (FireFox)
Actually, it does.

frostBite
June 29th, 2009, 03:26 PM
Thank you for all the responses. I'm working on my css coding a lot lately. Question: would a min-height also be necessay like said above? Would it be set as a pixel unit or percentage? Thank you :)

a tadster
June 29th, 2009, 07:06 PM
0 = 0% odd enough.
not in every browser

to some browsers it means 0px if you don't specify it.



p.s. i'm not new to this

Templarian
June 29th, 2009, 07:33 PM
not in every browser

to some browsers it means 0px if you don't specify it.
Weird enough... you won't believe this... 0px = 0

I can't tell if your just messing with us... or if your talking about a browser so old that no one even develops for, if it has less than 1% of the browser share just overlook it man their browser probably kills every site they are use to it by now... hehe :trout:

a tadster
June 29th, 2009, 07:42 PM
http://www.kyleschaeffer.com/best-practices/css-font-size-em-vs-px-vs-pt-vs/

and that link is a bit off topic but is the best page i found describing the differences,
in some browsers (like ie 6), if you don't specify, em, px, or percent, they assume px.

for 100% flashes in a browser it is percent that works the same cross-browser. i know this because of years of trial and error, try it yourself

Templarian
June 29th, 2009, 07:43 PM
^ We are not talking about fonts. http://kirupa.templarian.com/smh.gif

*hands tad a book on talking in context*

nykoelle
June 30th, 2009, 11:42 AM
Thank you for all the responses. I'm working on my css coding a lot lately. Question: would a min-height also be necessay like said above? Would it be set as a pixel unit or percentage? Thank you :)

When I use it, I set it the same as the height. Something like:

height: 100%;
min-height: 100%;

frostBite
June 30th, 2009, 05:19 PM
ook thank you nykoelle :)