W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2008

[whatwg] Using Math In CSS3

From: James Jeffery <cascadingstylez@googlemail.com>
Date: Tue, 5 Feb 2008 10:28:14 +0000
Message-ID: <972994690802050228x476492d0o6d697356d7cad3f0@mail.gmail.com>
Morning all.

Im not sure if this is already a recommendation, or its already been thought
about, but here goes.

Basically i was working on a task, a 2 column layout simple as anything,
heres the css:

body {width: 50em;}

div#mainNav {width: 10em;}

div#content {width: 40em;}

Now if i want to add a border, say 1pixel all around, i have to convert 1px
to an em unit and minus that from the width values (n-40em), then add 1px
border all around. It would take me a few seconds on the calculator, i know,
but would it not be easier to have something like?:

 body {width: 50em;}

div#mainNav {width: (10em - 1px);}

div#content {width: (40em - 1px);}

#mainNav, #content {border: red 1px solid;}

I mean im sure there would be great use for it on larger and different
tasks, the example i provided was very simple. Basically the algorithm would
automatically be able to convert between px, em, % etc.

Just an idea, and im looking forward to any comments.

Kind Regards.

James Jeffery
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20080205/7d30e9ca/attachment.htm>
Received on Tuesday, 5 February 2008 02:28:14 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:00 UTC