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

Re: [css3-page] Margin Boxes At-Syntax

From: Linss, Peter <peter.linss@hp.com>
Date: Mon, 20 Dec 2010 20:01:00 +0000
To: Christoph Päper <christoph.paeper@crissov.de>
CC: www-style list <www-style@w3.org>
Message-ID: <C3608881-C9D0-4B4E-A121-6B47DD3929B5@hp.com>
On Dec 19, 2010, at 6:32 AM, Christoph Päper wrote:

> 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);}
>  }
> 

Couldn't you simply set negative margins on the top-center and have it span the entire page?

ie:
@page {
  size 8.5in 11in;
  margin: 10%;
  @top-center {
    margin: -10%;
    content: url(myimage.png);
  }
}

As far as addressing outer and inner, you can have different @page blocks for left and right pages and simply use left and right within them as appropriate.

Peter

(I do prefer a single @rule for margin boxes myself, but it has already been implemented...)
Received on Monday, 20 December 2010 20:02:16 GMT

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