Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 10:31 PM
Harlan Messinger
Guest
 
Posts: n/a
Default width: enough;?

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.

  #2  
Old July 20th, 2005, 10:32 PM
brucie
Guest
 
Posts: n/a
Default Re: width: enough;?

in post: <news:bveki0$r50pj$1@ID-114100.news.uni-berlin.de>
"Harlan Messinger" <h.messinger@comcast.net> said:
[color=blue]
> 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.[/color]

URL?


--
brucie - i usenet nude
  #3  
Old July 20th, 2005, 10:32 PM
Harlan Messinger
Guest
 
Posts: n/a
Default Re: width: enough;?

brucie <shit@bruciesusenetshit.info> wrote:
[color=blue]
>in post: <news:bveki0$r50pj$1@ID-114100.news.uni-berlin.de>
>"Harlan Messinger" <h.messinger@comcast.net> said:
>[color=green]
>> 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.[/color]
>
>URL?[/color]

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.
  #4  
Old July 20th, 2005, 10:32 PM
Michael Rozdoba
Guest
 
Posts: n/a
Default Re: width: enough;?

Harlan Messinger wrote:[color=blue]
> brucie <shit@bruciesusenetshit.info> wrote:
>
>[color=green]
>>in post: <news:bveki0$r50pj$1@ID-114100.news.uni-berlin.de>
>>"Harlan Messinger" <h.messinger@comcast.net> said:
>>
>>[color=darkred]
>>>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.[/color]
>>
>>URL?[/color]
>
>
> http://gavelcade.com/form.asp, which validates Strict.[/color]

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
  #5  
Old July 20th, 2005, 10:32 PM
Steve Pugh
Guest
 
Posts: n/a
Default Re: width: enough;?

Harlan Messinger <hmessinger.removethis@comcast.net> wrote:[color=blue]
>brucie <shit@bruciesusenetshit.info> wrote:[color=green]
>>in post: <news:bveki0$r50pj$1@ID-114100.news.uni-berlin.de>
>>"Harlan Messinger" <h.messinger@comcast.net> said:
>>[color=darkred]
>>> 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.[/color]
>>
>>URL?[/color]
>
>http://gavelcade.com/form.asp, which validates Strict.[/color]

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 <steve@pugh.net> <http://steve.pugh.net/>
  #6  
Old July 20th, 2005, 10:32 PM
Harlan Messinger
Guest
 
Posts: n/a
Default Re: width: enough;?

Michael Rozdoba <mroz@nowhere.invalid> wrote:
[color=blue]
>Harlan Messinger wrote:[color=green]
>> brucie <shit@bruciesusenetshit.info> wrote:
>>
>>[color=darkred]
>>>in post: <news:bveki0$r50pj$1@ID-114100.news.uni-berlin.de>
>>>"Harlan Messinger" <h.messinger@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?[/color]
>>
>>
>> http://gavelcade.com/form.asp, which validates Strict.[/color]
>
>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.[/color]

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.
  #7  
Old July 20th, 2005, 10:32 PM
Steve Pugh
Guest
 
Posts: n/a
Default Re: width: enough;?

Harlan Messinger <hmessinger.removethis@comcast.net> wrote:[color=blue]
>Michael Rozdoba <mroz@nowhere.invalid> wrote:[color=green][color=darkred]
>>>>"Harlan Messinger" <h.messinger@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.
>>>>[/color]
>>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.[/color]
>
>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.[/color]

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 <steve@pugh.net> <http://steve.pugh.net/>
  #8  
Old July 20th, 2005, 10:32 PM
Nick Theodorakis
Guest
 
Posts: n/a
Default Re: width: enough;?

On Sat, 31 Jan 2004 21:07:26 +0000, Steve Pugh <steve@pugh.net> wrote:


[...]
[color=blue]
>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).[/color]

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
nick_theodorakis@hotmail.com
nicholas_theodorakis [at] urmc [dot] rochester [dot] edu
  #9  
Old July 20th, 2005, 10:32 PM
Brian
Guest
 
Posts: n/a
Default Re: width: enough;?

Steve Pugh wrote:[color=blue]
>
> 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).[/color]

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/

 

Bookmarks

Thread Tools

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

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles