Controlling the height of a div?

T

T.J.

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.)
 
J

Jeffrey Silverman

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...
 
T

T.J.

Jeffrey Silverman said:
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.
 
J

Jan Faerber

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.

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.
The .toptop was just an experiment to try to overcome the fact
I.E doesn't support min-width

ok
 
J

Jan Faerber

Neal said:
T.J.:


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.
 
N

Neal

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?
 
J

Jan Faerber

Neal said:
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!
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!!!
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!!!
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.
 
D

DJS2C

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top