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

%% values, Working UA?

From: Justin Wood <jw6057@bacon.qcc.mass.edu>
Date: Thu, 27 May 2004 22:54:49 -0400
Message-ID: <40B6A9F9.8080000@bacon.qcc.mass.edu>
To: Andrew Fedoniouk <news@terrainformatica.com>
Cc: www-style@w3.org

Andrew Fedoniouk wrote:

>Hi, Richard,
>
>I guess that %% units to be implemented will solve your problem.
>
>If you will write
>
>div {
>     padding: 10px;
>     margin: 10px;
>     height: 100%%;
>     border: 1px solid black;
>}
>
>You will get exactly what you want.
>
>100%% is 100% from "free space". Here "free space" is a container inner
>height minus borders margins and paddings of the div.
>
>================================================================
>
>And to other "boxing" gentlemen:  you did not read specs :).
>Box-sizing *is not* a solution for given task. No one box-sizing value will
>allow author to set *outer* box dimensions (which include margins)
>
>Andrew Fedoniouk.
>http://terrainformatica.com
>
>
>  
>
>>Hello,
>>I am currently writing a Beginning CSS book for Wiley. I've hit a snag
>>in explaining percentage height measurements.
>>
>>I have an example looking somthing like this:
>>
>>html, body {
>>     height: 100%;
>>     margin: 0;
>>}
>>
>>div {
>>     padding: 10px;
>>     margin: 10px;
>>     height: 100%;
>>     border: 1px solid black;
>>}
>>
>>Obviously this results in the <div> element spanning vertically larger
>>than the available window area, since padding, margins and borders are
>>added in addition to the 100% measurement.
>>
>>My question is, are there any solutions available or in the proposal
>>stage that would allow a designer to utilize the 100% measurement minus
>>the length of margins, padding and borders. I've done quite a bit of
>>digging in the specifications and have come up naught so far.
>>
>>I've seen proposals for the %% unit and I've also seen calc() floating
>>around. Where the solution would be:
>>
>>     height: calc(100% - 42px);
>>
>>Though I haven't yet found a reference to calc() in the specifications.
>>Not sure if that's just theoretical at this point or something really
>>being added to CSS.
>>
>>Any insight would be greatly appreciated!
>>
>>Regards,
>>Richard York
>>
>>--
>>:::::::::::::::::::::::::::::::::::::::::
>>The Spicy Peanut Project
>>http://www.spicypeanut.net
>>:::::::::::::::::::::::::::::::::::::::::
>>
>>
>>
>>    
>>
>
>
>  
>
Andrew,

    In aspects of humoring you, can you provide a link to your UA which 
supports '%%' as stated, as well as (to-me) re-provide your /mock/ spec 
on it.

    I among others can see what, if any problems we can find with that 
UA. in regards to '%%' at least... 

    Please provide along with it, what platforms it is designed to work 
on, what else (if anything is needed), and if you are willing to provide 
your source-code that implements the '%%' algorithim for anyone who is 
wondering.

Thanks
~Justin Wood
Received on Thursday, 27 May 2004 22:56:11 GMT

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