W3C home > Mailing lists > Public > www-style@w3.org > August 2013

[css-regions] margin of first paragrah of a region

From: François REMY <francois.remy.dev@outlook.com>
Date: Fri, 16 Aug 2013 23:20:31 +0200
Message-ID: <DUB120-W40A4A802A1320A7CE6700BA5470@phx.gbl>
To: "www-style@w3.org" <www-style@w3.org>, "mihnea@adobe.com" <mihnea@adobe.com>
CC: "lmcliste@adobe.com" <lmcliste@adobe.com>
Issue of the day: inter-paragraph margin.

Let's pretend I was trying to port over this "manual-region" code to [css-regions]:

  <div class="region">
   Abc...<BR>
   <figure>...</figure>
   Def...<BR>
  </div>
  
  <div class="region">
   <figure>...</figure>
   Ghi...<BR>
   Jkl...<BR>
  </div>
  

  p { margin: 10px }
  figure { margin: 30px; }

  .region {padding:5px}
  .region> :first-child { margin-top: 0px; }

How can I get this special effect that the first-paragraph in each region do not get pushed down by ther inter-paragraph margin?

My current trick has been to put all the margin on the bottom of paragraphs (which is probably how things should be in this case) but it cannot possibly work if I've a <figure> sibling to my paragraphs which requires a 30px on both top and bottom (but still 0px top margin as first visual child of a box, ie: the margin collapses in the inter-region world).

Any suggestion?
François 		 	   		  
Received on Friday, 16 August 2013 21:20:58 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:33 UTC