W3C home > Mailing lists > Public > www-style@w3.org > May 2004

Re: CSS: %% length unit. Proposal. Some clarifications.

From: Ian Hickson <ian@hixie.ch>
Date: Sun, 9 May 2004 09:07:07 +0000 (UTC)
To: Andrew Fedoniouk <news@terrainformatica.com>
Cc: www-style@w3.org
Message-ID: <Pine.LNX.4.58.0405090901540.9965@dhalsim.dreamhost.com>

On Sat, 8 May 2004, Andrew Fedoniouk wrote:
>
> Take a look on screenshot:
> http://www.terrainformatica.com/htmengine/screenshots/tablebackgrounds.png
> At the bottom you will find three edit boxes with captions "from" , "to"
> and "subject", they are declared in HTML and rendered in my experimental
> browser as:
>
> <P>from:<INPUT ... style="width:100%%" /></P>
> <P>to:<INPUT ... style="width:100%%" /></P>
>
> <P>subject:<INPUT ... style="width:100%%" /></P>
>
> How to achieve same layout in current or proposed CSS?

Using CSS2 (1998):

   p { display: table; white-space: nowrap; }
   input { display: table-cell; width: 100%; }

That should work fine. (If you put a <label> around the text labels, you
can then give it 'display: table-cell' as well which would give you finer
control over the wrapping.


> If we introduce calc() what formula would be?

No need for a formula, this is possible today in CSS2.

-- 
Ian Hickson                                      )\._.,--....,'``.    fL
U+1047E                                         /,   _.. \   _\  ;`._ ,.
http://index.hixie.ch/                         `._.-(,_..'--(,_..'`-.;.'
Received on Sunday, 9 May 2004 05:07:20 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:29 GMT