Re: start-edge border and padding... where'd they go?

Good morning, Mark,

At 2003-06-27 12:23 -0700, Mark Lundquist wrote:
>>A common misconception is that a reader will see "Common Border, Padding 
>>and Background Properties" and think borders and padding actually applies 
>>(gee, I wonder why??)
>
>Exactly!  I've figured out that things are not what they seem to be, my 
>naive assumptions are not borne out, etc. :-)... so now I'm trying to get 
>my head around the details.

Well, as Klaas rightfully (and thankfully) pointed out, I was off on an 
irrelevant tangent in my hasty earlier response.

>If I'm going to do this stuff, I want to really understand it :-)

Sure ... but how did you learn HTML?  Did you learn from a book reading 
about angle brackets and then get success with your first instance?  I 
learned XSL-FO the same way I learned HTML:  I started with a short 15-line 
one-block XSL-FO instance in a text editor and then "played" with the 
instance learning about what effects give what results.

This is the way I start off my students.

>Okay.  My documents have a fixed layout (two pages at most).

:{)} At most?  So, not quite fixed ... either one or two pages.

>They're templates that select content "pull-model" style using 
><xsl:call-template>.  There isn't much content, actually... a couple of 
>small images and small blocks containing text.

Getting to the XSL-FO usually (though not always) isn't important ... when 
I teach XSL-FO I teach it as a vocabulary.  In fact there are two ways of 
doing each of the exercises: as standalone XSL-FO instances in an editor, 
or as XSLT stylesheets.  This way I have successfully taught the vocabulary 
to people who don't know XSLT.

>These blocks have to be placed in fixed positions.  There is a fixed 
>"margin" (let's say 10cm

cm?  did you mean mm?

>or so) within the page that none of the fixed positions encroach, but some 
>are aligned to it, i.e. they abut one or two of the inner edges of the 
>"margin".

Fine ....

>For a hacky reason that I don't care to go into, I can't use page-level 
>margin properties.

Fine ....

>   It has to do with a background image.

... in your region body that is full page dimensions?

>But Mark doesn't want to talk about that right now :-).  And, I would like 
>to understand if there is a general solution that can apply at any nesting 
>level, i.e. doesn't rely on page-level properties.

General solution?  No ... any time you create an absolutely positioned 
block container, you have to fit your content into it ... it cannot be a 
"flowed" area as it is considered "out of line".  You also cannot have 
multiple columns in an absolutely positioned block container (as requested 
by one of my students).

>And, there is the intuition that "if this isn't what padding is for, then 
>what is it for?".

Padding is in the box model to separate the inside edge of the border from 
the outside edge of the content.

The padding rectangle also defines the background box for an 
object.  Spacing shows through the parent's background, while padding shows 
through the object's background.  Gaps in the border show the parent's 
background.

>(For that matter, I could even do away with the containing block and 
>simply fix everything relative to the page, but that's not as good a way 
>to code it).

"good"?  There are certainly times when this is necessary.

>But if there is a way to do it with padding, I would still like to 
>understand it, or else understand why the padding approach was wrong.

Padding is "in the box" for a construct, and constructs that are not 
absolutely positioned are positioned relative to their siblings in the 
stacking model.  Block level constructs are as wide in the 
inline-progression direction as their parents, thus forcing siblings to 
stack in the block-progression direction.

Your requirement stated as "There isn't much content, actually... a couple 
of small images and small blocks containing text.  These blocks have to be 
placed in fixed positions." implies to me that utilizing the absolutely 
positioned block containers really is the best way, and not to try and 
build on relative-positioning constructs of the padding areas of blocks.

I hope this is helpful.

......................... Ken


--
Upcoming hands-on courses: in-house corporate training available;
North America public:  XSL-FO Aug 4,2003; XSLT/XPath Aug 12, 2003

G. Ken Holman                mailto:gkholman@CraneSoftwrights.com
Crane Softwrights Ltd.         http://www.CraneSoftwrights.com/f/
Box 266, Kars, Ontario CANADA K0A-2E0   +1(613)489-0999 (F:-0995)
ISBN 0-13-065196-6                      Definitive XSLT and XPath
ISBN 0-13-140374-5                              Definitive XSL-FO
ISBN 1-894049-08-X  Practical Transformation Using XSLT and XPath
ISBN 1-894049-11-X              Practical Formatting Using XSL-FO
Member of the XML Guild of Practitioners:    http://XMLGuild.info
Male Breast Cancer Awareness http://www.CraneSoftwrights.com/f/bc

Received on Saturday, 28 June 2003 11:58:53 UTC