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

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 UTC