W3C home > Mailing lists > Public > www-style@w3.org > January 2011

Re: margins, ems and context

From: Anton Prowse <prowse@moonhenge.net>
Date: Tue, 25 Jan 2011 19:08:16 +0100
Message-ID: <4D3F1190.5070503@moonhenge.net>
To: www-style@w3.org
CC: Niels Matthijs <niels.matthijs@internetarchitects.be>
On 25/01/2011 15:51, Niels Matthijs wrote:
> currently the box-model states that margins are integral part of the
> box. This means that when you change the font-size of a css box, margins
> defined in ems will change too. This is more often than not (never ran
> into a situation where I was actually happy with it, but who knows ...)
> unwanted behavior. You usually want margins of a box to match themselves
> to the font-size of its parent box (creating a clean vertical grid).

The example on your blog:

"when you're playing around with headings and the left and rights 
margins of the heading box keep changing every time you adapt the 
font-size of this heading"

makes me question why you've got horizontal margins on your heading in 
the first place, or at least, why you're defining them in ems.

Can you provide a use case, that is, not just an example of what happens 
but also an explanation of why, specifically, you don't want that to 
happen and why you want something else to happen instead.

In particular, why would having those horizontal margins dependent on 
the font size of the containing block be useful?

Anton Prowse
Received on Tuesday, 25 January 2011 18:09:05 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:55 UTC