W3C home > Mailing lists > Public > www-style@w3.org > December 2010

[css3-page] Margin Boxes At-Syntax

From: Christoph Päper <christoph.paeper@crissov.de>
Date: Sun, 19 Dec 2010 15:32:01 +0100
Message-Id: <C88C9B67-5671-4214-A72F-2F07B72E2244@crissov.de>
To: www-style list <www-style@w3.org>
Have the margin at-rules already been implmented, e.g. in Prince? 
If so, disregard the rest of this mail.

I’ve recently made a brochure (with Latex) that had an margin-less image across the whole page header, including the corners. If I understand the Paged Media WD and ED correctly, I would have to split the image in three if I wanted to implement the same layout with CSS, because I actually would need ‘@top’ which is not available. The two-sided brochure also had the same content in the outer page margin. There neither is ‘@outer’ nor can I group the selectors ‘left-middle’ and ‘right-middle’, because the odd/even selection is done for ‘@page’.

To address both issues I believe a syntax like the following would work better:

  @margin <margin-box> [ , <margin-box> ]*

  <margin-box> = <vertical> <horizontal>? | <horizontal> <vertical>? 
               | [ <vertical> <horizontal> | <horizontal> <vertical> ] :corner 

  <vertical>   = :top | :bottom | :middle | :header | :footer
  <horizontal> = :right | :left | :center | :outer | :inner

I think ‘:header’ and ‘:footer’ are not really necessary.

Example XI would then look like this:

  @page {
    size: 8.5in 11in;
    margin: 10%;

    @margin :top:left {content: "Hamlet";}
    @margin :top:right {content: "Page " counter(page);}
  }

or rather

  @page {
    size: letter portrait;
    margin: 10%;

    @margin :top:inner {content: "Hamlet";}
    @margin :top:outer {content: "Page " counter(page);}
  }
Received on Sunday, 19 December 2010 14:32:41 GMT

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