By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,648 Members | 1,203 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,648 IT Pros & Developers. It's quick & easy.

width: enough;?

P: n/a
I can't seem to figure out how to specify that the width of a block should
be "enough". For example, I've got a form on a page. With styles, I've given
the form a background and a border. It takes up 100% of the width of the
viewport. If the labels and controls are narrow, I've got a great light gray
expanse on the right side of the form.

If I set the width explicitly to some number of ems or some percentage, it
forces the form's content to wrap. I could add styles to prevent the
wrapping, but if someone uses a narrow screen then I *do* want the contents
to wrap. In other words, I want the screen's dimensions to cause wrapping,
but not the form's dimensions. On the contrary, I want the form to respect
its content.

Your guidance?

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.

Jul 20 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
in post: <news:bv************@ID-114100.news.uni-berlin.de>
"Harlan Messinger" <h.*********@comcast.net> said:
I can't seem to figure out how to specify that the width of a block should
be "enough". For example, I've got a form on a page. With styles, I've given
the form a background and a border. It takes up 100% of the width of the
viewport. If the labels and controls are narrow, I've got a great light gray
expanse on the right side of the form.


URL?
--
brucie - i usenet nude
Jul 20 '05 #2

P: n/a
brucie <sh**@bruciesusenetshit.info> wrote:
in post: <news:bv************@ID-114100.news.uni-berlin.de>
"Harlan Messinger" <h.*********@comcast.net> said:
I can't seem to figure out how to specify that the width of a block should
be "enough". For example, I've got a form on a page. With styles, I've given
the form a background and a border. It takes up 100% of the width of the
viewport. If the labels and controls are narrow, I've got a great light gray
expanse on the right side of the form.


URL?


http://gavelcade.com/form.asp, which validates Strict.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #3

P: n/a
Harlan Messinger wrote:
brucie <sh**@bruciesusenetshit.info> wrote:

in post: <news:bv************@ID-114100.news.uni-berlin.de>
"Harlan Messinger" <h.*********@comcast.net> said:

I can't seem to figure out how to specify that the width of a block should
be "enough". For example, I've got a form on a page. With styles, I've given
the form a background and a border. It takes up 100% of the width of the
viewport. If the labels and controls are narrow, I've got a great light gray
expanse on the right side of the form.


URL?

http://gavelcade.com/form.asp, which validates Strict.


Can you float it? That seems to work (FB 0.7, IE 6, Op 7.23) though I
have to confess to not knowing why, despite feeling this will be quite
obvious.

--
Michael
m r o z a t u k g a t e w a y d o t n e t
Jul 20 '05 #4

P: n/a
Harlan Messinger <hm*******************@comcast.net> wrote:
brucie <sh**@bruciesusenetshit.info> wrote:
in post: <news:bv************@ID-114100.news.uni-berlin.de>
"Harlan Messinger" <h.*********@comcast.net> said:
I can't seem to figure out how to specify that the width of a block should
be "enough". For example, I've got a form on a page. With styles, I've given
the form a background and a border. It takes up 100% of the width of the
viewport. If the labels and controls are narrow, I've got a great light gray
expanse on the right side of the form.


URL?


http://gavelcade.com/form.asp, which validates Strict.


form {display: inline-block;}

table or table-cell would do just as well as inline-block.

However, none of the above values are supported by IE.

form {max-width: 20em; }
works well in better browsers (Opera, Mozilla, etc.), but has no
effect in IE.

A slight modification
form {width: 20em; max-width: 20em; }
body>form {width: auto;}
works just as well in better browsers, but causes horizontal scrolling
instead of wrapping at smaller window sizes in, guess what, IE.

So many ways of doing this, but IE is just useless. :-(

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #5

P: n/a
Michael Rozdoba <mr**@nowhere.invalid> wrote:
Harlan Messinger wrote:
brucie <sh**@bruciesusenetshit.info> wrote:

in post: <news:bv************@ID-114100.news.uni-berlin.de>
"Harlan Messinger" <h.*********@comcast.net> said:
I can't seem to figure out how to specify that the width of a block should
be "enough". For example, I've got a form on a page. With styles, I've given
the form a background and a border. It takes up 100% of the width of the
viewport. If the labels and controls are narrow, I've got a great light gray
expanse on the right side of the form.

URL?

http://gavelcade.com/form.asp, which validates Strict.


Can you float it? That seems to work (FB 0.7, IE 6, Op 7.23) though I
have to confess to not knowing why, despite feeling this will be quite
obvious.


I thought of that, and it'll certainly work, except that the next
block on the page will always have to clear it, and that seems like a
hack that shouldn't be necessary.

--
Harlan Messinger
Remove the first dot from my e-mail address.
Veuillez ôter le premier point de mon adresse de courriel.
Jul 20 '05 #6

P: n/a
Harlan Messinger <hm*******************@comcast.net> wrote:
Michael Rozdoba <mr**@nowhere.invalid> wrote:
"Harlan Messinger" <h.*********@comcast.net> wrote:

>I can't seem to figure out how to specify that the width of a block should
>be "enough". For example, I've got a form on a page. With styles, I've given
>the form a background and a border. It takes up 100% of the width of the
>viewport. If the labels and controls are narrow, I've got a great light gray
>expanse on the right side of the form.

Can you float it? That seems to work (FB 0.7, IE 6, Op 7.23) though I
have to confess to not knowing why, despite feeling this will be quite
obvious.


I thought of that, and it'll certainly work, except that the next
block on the page will always have to clear it, and that seems like a
hack that shouldn't be necessary.


It may or may not matter to you, but under CSS 2 rules a floated
element must have a specified width. Under CSS 2.1 the width becomes
optional (and browser already act along these lines).

Steve

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <st***@pugh.net> <http://steve.pugh.net/>
Jul 20 '05 #7

P: n/a
On Sat, 31 Jan 2004 21:07:26 +0000, Steve Pugh <st***@pugh.net> wrote:
[...]
It may or may not matter to you, but under CSS 2 rules a floated
element must have a specified width. Under CSS 2.1 the width becomes
optional (and browser already act along these lines).


Except for MacIE5. If a float without a width contains another block,
MacIE5 will give it a width of 100% of the container.

Nick

--
Nick Theodorakis
ni**************@hotmail.com
nicholas_theodorakis [at] urmc [dot] rochester [dot] edu
Jul 20 '05 #8

P: n/a
Steve Pugh wrote:

It may or may not matter to you, but under CSS 2 rules a floated
element must have a specified width. Under CSS 2.1 the width
becomes optional (and browser already act along these lines).


Except for IE 5/Mac, which stubbornly sticks to the 2.0 rule. ;-)

--
Brian (follow directions in my address to email me)
http://www.tsmchughs.com/

Jul 20 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.