Controlling the height of a div?

Discussion in 'HTML' started by T.J., Dec 5, 2004.

  1. T.J.

    T.J. Guest

    Hi all,
    How can I control the height of a div so that it grows
    longer as the page is narrowed?

    I have a blue div on the left of this page,
    http://www.sim64.co.uk/treadmills.html
    It looks fine on my full screen with a 1024 x 768 resolution
    but how can I make the blue div expand in height on a
    smaller resolution or when the page is narrowed?
    Ideally I would like it to always fill the container.

    I'm new to all this, so a page critique would be appreciated.
    TIA

    (Cross-posted to alt.html and alt.www.webmaster, apologies if
    this is the wrong thing to do, I never know when to cross-post or
    when to send to both.)
    T.J., Dec 5, 2004
    #1
    1. Advertising

  2. On Sun, 05 Dec 2004 20:42:42 +0000, T.J. wrote:

    > Hi all,
    > How can I control the height of a div so that it grows
    > longer as the page is narrowed?


    Have you tried the "height" CSS attribute and/or the "min-height"
    attribute. Both only work on block-level elements, which DIVs typically
    are.

    I see other problems, but really, for critiques, you should post to
    alt.html.critique ore comp.infosystems.www.authoring.site-design

    later...

    --
    Jeffrey D. Silverman |
    Website | http://www.newtnotes.com

    Drop "PANTS" to reply by email
    Jeffrey Silverman, Dec 6, 2004
    #2
    1. Advertising

  3. T.J.

    Jan Faerber Guest

    Jan Faerber, Dec 7, 2004
    #3
  4. T.J.

    Jan Faerber Guest

    Jan Faerber, Dec 7, 2004
    #4
  5. T.J.

    T.J. Guest

    "Jeffrey Silverman" <> wrote in message
    news:p...
    > On Sun, 05 Dec 2004 20:42:42 +0000, T.J. wrote:
    >
    >> Hi all,
    >> How can I control the height of a div so that it grows
    >> longer as the page is narrowed?

    >
    > Have you tried the "height" CSS attribute and/or the "min-height"
    > attribute. Both only work on block-level elements, which DIVs typically
    > are.


    Setting it to a height using "height" is no problem, but as the page
    gets longer when narrowed, I want the height to expand to suit.

    > I see other problems, but really, for critiques, you should post to
    > alt.html.critique ore comp.infosystems.www.authoring.site-design


    Thanks, I will go and ask there.
    From what I've heard though, I think I'm too much of a newbee and
    will probably get ripped apart for asking questions in there.

    > --
    > Jeffrey D. Silverman |
    > Website | http://www.newtnotes.com
    >
    > Drop "PANTS" to reply by email
    >
    T.J., Dec 7, 2004
    #5
  6. T.J.

    T.J. Guest

    "Jan Faerber" <jancfaerber_spider@monkey_hotmail.com> wrote in message
    news:E88td.71994$...
    > T.J. wrote:
    >
    >> Hi all,
    >> How can I control the height of a div so that it grows
    >> longer as the page is narrowed?
    >>

    >
    > hehe ... "Congratulations, no errors!" ...
    > http://www.htmlhelp.com/tools/validator/
    >
    > what is
    > .toptop {width:700px; } ? ... newbee question
    >
    >
    > try it with tables:
    > http://html.janfaerber.com/files/simnew.html
    >
    >


    Thanks,
    but your version messes up on my system and from
    what everyone says here I should try to avoid tables
    (I don't know why?)
    The .toptop was just an experiment to try to overcome the fact
    I.E doesn't support min-width
    T.J., Dec 7, 2004
    #6
  7. T.J.

    Jan Faerber Guest

    T.J. wrote:

    >> try it with tables:
    >> http://html.janfaerber.com/files/simnew.html


    > Thanks,
    > but your version messes up on my system


    I just have Mozilla, Opera and Konqueror at the moment. In Mozilla it looks
    a little bit different but your version also has some lacks of functioning
    on my system:
    the top menu can't be seen proberly (class orange I think).

    > what everyone says here I should try to avoid tables
    > (I don't know why?)


    That is true, they prefer to do everything with <div> and <p> now.
    .... variant strict.
    But it is not a must.

    >>> How can I control the height of a div so that it grows
    >>> longer as the page is narrowed?


    Your problem is that height:100% refers to the screen or the browser height.
    The div would fill up 'only' 100% of the screen but you have to scroll down
    on your page because there is more content in the <div> section but it
    won't get larger that way down to the very bottom. It is just 100% of the
    window.
    You could try it with a fix height in pixel.

    >> what is
    >> .toptop {width:700px; } ? ... newbee question


    > The .toptop was just an experiment to try to overcome the fact
    > I.E doesn't support min-width


    ok




    --
    Jan

    http://linux.janfaerber.com
    Jan Faerber, Dec 7, 2004
    #7
  8. T.J.

    Neal Guest

    T.J.:

    > Thanks,
    > but your version messes up on my system and from
    > what everyone says here I should try to avoid tables
    > (I don't know why?)


    Here's one page which discusses it, Google turns up more:

    http://www.workingwith.me.uk/tablefree/why/
    Neal, Dec 7, 2004
    #8
  9. T.J.

    Jan Faerber Guest

    Neal wrote:

    > T.J.:
    >
    >> Thanks,
    >> but your version messes up on my system and from
    >> what everyone says here I should try to avoid tables
    >> (I don't know why?)

    >
    > Here's one page which discusses it, Google turns up more:
    >
    > http://www.workingwith.me.uk/tablefree/why/


    But isn't that more a very complex thing?
    Looking at the link above gives me a kind of feeling that takes away
    'presentation'. The feeling is I could break something, it is so narrow
    minded. Something is missing! You have a very strict philosophy of
    presentation and some content which points out why tables are evil. I miss
    XML in that case, I miss databases, I miss the real need for using CSS, CSS
    and nothing else. It looks like a piece of paper flowing in the wind and
    you catch it. Charming ... it is charming.

    But why is it when many people say 'frames are evil' that on www.php.net
    they use tables? On that page there is a form to search for functions and
    words on the whole site. It is still not a huge project with databases but
    it is already quite a lot. So my opinion is that it would be more important
    to structure the tutorials, declarations and definitions covering the field
    of CSS in a manner that makes use of all its advantages and not to break
    completely with anything that happened before.



    --
    Jan

    http://linux.janfaerber.com
    Jan Faerber, Dec 7, 2004
    #9
  10. T.J.

    Neal Guest

    On Tue, 07 Dec 2004 20:39:17 GMT, Jan Faerber
    <jancfaerber_spider@monkey_hotmail.com> wrote:

    > Looking at the link above gives me a kind of feeling that takes away
    > 'presentation'.


    Why is that? CSS can do the presentation. Why do you need HTML to do it?

    > The feeling is I could break something, it is so narrow
    > minded. Something is missing! You have a very strict philosophy of
    > presentation and some content which points out why tables are evil. I
    > miss
    > XML in that case, I miss databases, I miss the real need for using CSS,
    > CSS
    > and nothing else. It looks like a piece of paper flowing in the wind and
    > you catch it. Charming ... it is charming.


    You lost me there.

    I don't hate tables. I love them. That's why I want to see them put to
    their proper use - to organize tabular content.

    It would be nice if UAs could vary the rendering of table content - show
    columns or rows individually, allow easier cross-table comparisons, etc.
    But as long as most instances of table markup are not for table content
    but for arranging content in a grid purely for presentation, that can't
    really be done.

    I don't think there's much sense in using tables for layout anymore. At
    one time it did, but with CSS available there's no good reason to choose
    table layout over that. The closest there is to a good reason is this:
    people don't know how to use CSS yet, they're very familiar with tables.

    > But why is it when many people say 'frames are evil' that on www.php.net
    > they use tables?


    Frames are not tables. What are you saying??

    > On that page there is a form to search for functions and
    > words on the whole site. It is still not a huge project with databases
    > but
    > it is already quite a lot. So my opinion is that it would be more
    > important
    > to structure the tutorials, declarations and definitions covering the
    > field
    > of CSS in a manner that makes use of all its advantages and not to break
    > completely with anything that happened before.


    You lost me again. Are you saying there should be a search site for CSS
    properties and values?
    Neal, Dec 7, 2004
    #10
  11. T.J.

    Jan Faerber Guest

    Neal wrote:

    > On Tue, 07 Dec 2004 20:39:17 GMT, Jan Faerber
    > <jancfaerber_spider@monkey_hotmail.com> wrote:
    >
    >> Looking at the link above gives me a kind of feeling that takes away
    >> 'presentation'.

    >
    > Why is that? CSS can do the presentation. Why do you need HTML to do it?


    It is a problem of communication in a team. As a beginner I learned html and
    nobody asked for css. Everybody prefers to let me work and work and work
    with html, with DW or Frontpage but in the end everything will be deleted
    and something else will be done. If you don't want to talk with me I can
    not read your thoughts. Tell me to do it with html or with css!

    >> The feeling is I could break something, it is so narrow
    >> minded. Something is missing! You have a very strict philosophy of
    >> presentation and some content which points out why tables are evil. I
    >> miss
    >> XML in that case, I miss databases, I miss the real need for using CSS,
    >> CSS
    >> and nothing else. It looks like a piece of paper flowing in the wind and
    >> you catch it. Charming ... it is charming.

    >
    > You lost me there.
    >
    > I don't hate tables. I love them. That's why I want to see them put to
    > their proper use - to organize tabular content.


    I know what you are trying to say: Hey customer - buy my products - they are
    listed on my page in this table! or ... Hey student - open my dictionary on
    3xwdotdictdotcom and learn the vocabulary I listed for you in those tables.

    There is a little problem if you want to automize presentation with css,
    isn't it?

    > It would be nice if UAs could vary the rendering of table content - show
    > columns or rows individually, allow easier cross-table comparisons, etc.
    > But as long as most instances of table markup are not for table content
    > but for arranging content in a grid purely for presentation, that can't
    > really be done.


    That is an approach with css for partially sighted people - so they can
    listen to table content they mark with their cursor.

    > I don't think there's much sense in using tables for layout anymore. At
    > one time it did, but with CSS available there's no good reason to choose
    > table layout over that. The closest there is to a good reason is this:
    > people don't know how to use CSS yet, they're very familiar with tables.


    I have to read that more often. I easely forget it again. But I hope it is
    not too late for me to get it right with css!!!

    >> But why is it when many people say 'frames are evil' that on www.php.net
    >> they use tables?

    >
    > Frames are not tables. What are you saying??


    My problem is that I have to know how tables and frames work at least at
    their basics. But I know it is very, very important to know css. CSS is
    everything. You are absolutly right!!!

    >> On that page there is a form to search for functions and
    >> words on the whole site. It is still not a huge project with databases
    >> but
    >> it is already quite a lot. So my opinion is that it would be more
    >> important
    >> to structure the tutorials, declarations and definitions covering the
    >> field
    >> of CSS in a manner that makes use of all its advantages and not to break
    >> completely with anything that happened before.

    >
    > You lost me again. Are you saying there should be a search site for CSS
    > properties and values?


    I don't want to talk about things before they are here. But I really would
    appreciate it to have a page done with CSS talking about CSS. I mean CSS is
    not the end of everything - it is a wide field.



    --
    Jan

    http://linux.janfaerber.com
    Jan Faerber, Dec 9, 2004
    #11
  12. T.J.

    DJS2C Guest

    Re: Controlling the height of a div? - Sorry to but in :) <div> help


    >
    > I don't think there's much sense in using tables for layout anymore. At
    > one time it did, but with CSS available there's no good reason to choose
    > table layout over that. The closest there is to a good reason is this:
    > people don't know how to use CSS yet, they're very familiar with tables.
    >


    But Im just about to start to use <divs> and layers (I chickened out with
    the site im doing now as I want to finish it, vaidate it and get paid..)
    and I use CSS to format my page I layout and position with tables/nested
    tables.

    Will I now be using <divs> / layers for layout and still CSS for formating
    AND Positioning.
    I started but got confused as to when I should use css or 'local options'

    hope that makes sence

    James
    DJS2C, Dec 13, 2004
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. HJ
    Replies:
    5
    Views:
    833
    Jonathan N. Little
    Sep 1, 2006
  2. K Viltersten

    <div ... /> and <div ...></div>

    K Viltersten, Mar 30, 2009, in forum: ASP .Net
    Replies:
    4
    Views:
    726
  3. muggslab

    Div Height = Image height. help

    muggslab, Feb 1, 2010, in forum: HTML and CSS
    Replies:
    1
    Views:
    853
    muggslab
    Feb 1, 2010
  4. Don Vaillancourt

    How to tell height of div where height is not set?

    Don Vaillancourt, Jan 28, 2005, in forum: Javascript
    Replies:
    8
    Views:
    133
    Dietmar Meier
    Jan 31, 2005
  5. Replies:
    0
    Views:
    113
Loading...

Share This Page