Re: position / size arithmetic?

> 
> 
> 3, but is there a way to do the following? Say I have a picture that is 
> 50px high, and I want it exactly centered horizontally.  I would like to 

margin-left:auto; margin-right:auto


> 100% - 10px, where the border of the box is 5px.  This way one could 

Size is measured outside of the border, so I don't see that this case
serves any useful purpose.

Whenever you think you need px units, you should question very carefully
whether you really do, as the use of such units tends to create 
device dependence and may suggest that text also needs to be an absolute
size, which is an accessibility no-no.

> ensure that the box (including borders) would be 100% of the containing 
> container. 

Calculated sizes have been  proposed on many occasions, and I believe
they are already in the current CSS3 proposal, albeit, as a special
function.

The main concern tends to be to avoid getting anything like the power of
scripting, with the associated security problems.

Received on Saturday, 2 September 2006 17:31:47 UTC