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

Re: Add margin-x and margin-y properties (same for padding and border-*)

From: Alan Gresley <alan@css-class.com>
Date: Wed, 18 Jan 2012 03:19:37 +1100
Message-ID: <4F159F99.7080902@css-class.com>
To: "Kang-Hao (Kenny) Lu" <kennyluck@csail.mit.edu>
CC: "Marat Tanalin | tanalin.com" <mtanalin@yandex.ru>, WWW Style <www-style@w3.org>
On 17/01/2012 12:20 AM, Kang-Hao (Kenny) Lu wrote:
> (12/01/16 10:17), Alan Gresley wrote:
>> So how does this overrule default margins [1] on block level elements
>> or overrule the property 'margin'?
>
> As far as I can tell, margin-x/y are just shorthand properties (margin-x
> for margin-left/right, margin-y for margin-top/bottom) so the overriding
> rule seems quite clear. Can you make an example that this is not the case?

<!DOCTYPE html>
<style type="text/css">
h1 {
   font-size: 10em;
   background: silver;
   /* margin: 0.25em 0; */
   margin-y: 0.25em; /* this can never overrule the property "margin" */
}
</style>
<h1>Text</h1>
<p>Some more text</p>


How is the property 'margin-y' going to overrule my default margin 
'margin: 0.67em 0' which is found in the UA default style sheet?

Here is the default style for the <h1> element for Gecko [1]?


1. http://mxr.mozilla.org/mozilla/source/layout/style/html.css#107




-- 
Alan Gresley
http://css-3d.org/
http://css-class.com/
Received on Tuesday, 17 January 2012 16:20:19 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:48 GMT