Go Back   Velocity Reviews > Newsgroups > HTML
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

HTML - CSS div height 100%

 
Thread Tools Search this Thread
Old 05-22-2006, 03:29 AM   #1
Default CSS div height 100%


i'm writing this only because i spent a good two days endlessly trying
to solve this problem and couldn't find anything on the internet that
actually helped. I eventually figured out the solution, as no doubt so
does everyone (hence the solution never actually being posted: it seems
too obvious to bother)... but had i found it sooner, i would have been
happy, so here goes:

if you're trying to get a CSS div to span the total height of the
window and scrolling is likely to be involved (for instance, a menu
sidebar), don't use the height: 100% tag! set margin-top: 0px and
margin-bottom:0px.



jaschreiber@gmail.com
  Reply With Quote
Old 05-22-2006, 05:38 AM   #2
dorayme
 
Posts: n/a
Default Re: CSS div height 100%

In article
< .com>,
wrote:

> i'm writing this only because i spent a good two days endlessly trying
> to solve this problem and couldn't find anything on the internet that
> actually helped. I eventually figured out the solution, as no doubt so
> does everyone (hence the solution never actually being posted: it seems
> too obvious to bother)... but had i found it sooner, i would have been
> happy, so here goes:
>
> if you're trying to get a CSS div to span the total height of the
> window and scrolling is likely to be involved (for instance, a menu
> sidebar), don't use the height: 100% tag! set margin-top: 0px and
> margin-bottom:0px.


Why use any height at all?

--
dorayme
  Reply With Quote
Old 05-22-2006, 07:32 AM   #3
pecan
 
Posts: n/a
Default Re: CSS div height 100%

wrote:
> i'm writing this only because i spent a good two days endlessly trying
> to solve this problem and couldn't find anything on the internet that
> actually helped. I eventually figured out the solution, as no doubt so
> does everyone (hence the solution never actually being posted: it seems
> too obvious to bother)... but had i found it sooner, i would have been
> happy, so here goes:
>
> if you're trying to get a CSS div to span the total height of the
> window and scrolling is likely to be involved (for instance, a menu
> sidebar), don't use the height: 100% tag! set margin-top: 0px and
> margin-bottom:0px.
>


Thank you. I was having problems like that, and also didn't get an
answer on another news group. Now you've solved it for me.

CM
  Reply With Quote
Old 05-22-2006, 08:18 AM   #4
Neredbojias
 
Posts: n/a
Default Re: CSS div height 100%

To further the education of mankind, vouchsafed:

> i'm writing this only because i spent a good two days endlessly trying
> to solve this problem and couldn't find anything on the internet that
> actually helped. I eventually figured out the solution, as no doubt so
> does everyone (hence the solution never actually being posted: it seems
> too obvious to bother)... but had i found it sooner, i would have been
> happy, so here goes:
>
> if you're trying to get a CSS div to span the total height of the
> window and scrolling is likely to be involved (for instance, a menu
> sidebar), don't use the height: 100% tag! set margin-top: 0px and
> margin-bottom:0px.


Hmm. What if you just don't want any horizontal margins on the div?

--
Neredbojias
Infinity has its limits.
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump