W3C home > Mailing lists > Public > www-style@w3.org > April 1997

Re: indents

From: Jon Bosak <bosak@atlantic-83.Eng.Sun.COM>
Date: Mon, 14 Apr 1997 15:17:38 -0700
Message-Id: <199704142217.PAA05041@boethius.eng.sun.com>
To: www-style@w3.org
[Greg Kostello:]

| Defining the stylist behavior for the first paragraph following a
| headline fulfills a much desired need.

Here's how you would do it in DSSSL:

   (element P
     (make paragraph
       first-line-start-indent: (if (first-sibling?)

Notice that this requires no change at all to the document.

| Although, IMHO it doesn't go far enough. Typically, the first and last
| paragraphs in a story may get special treatment, such as different
| indentation on the first paragraph and perhaps a decorative rule (not
| inline) for the last paragraph.

Here you go:

   (element P
     (make paragraph
       first-line-start-indent: (if (first-sibling?)
	(if (last-sibling?)
	    (make rule
		  orientation: 'horizontal
		  display-alignment: 'start
		  space-before: 6pt
		  space-after: 6pt
		  line-thickness: 1pt
		  length: 30pica
		  start-indent: (inherited-start-indent))

| A different style sheet may produce an altogether different
| look. Still, that may not be sufficient. For example, suppose you want
| to describe every other paragraph as having some special stylistic
| treatment (say a background shade of gray).

How about the "Herb Caen" treatment (every other paragraph in bold)?

   (element P
     (make paragraph
       font-weight: (if (= 0 (modulo (child-number) 2))
			' bold

Or did Caen always start with the first paragraph in bold and the
second one in medium?  I can't remember.  Good thing we can change the
treatment around without touching the content, isn't it?

       font-weight: (if (= 1 (modulo (child-number) 2))
			' bold

| I think we need a way of specifying style as applying to a pattern in
| a sequence of elements. Opinions?

What a great idea.  :-)

Received on Monday, 14 April 1997 18:18:11 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:43 UTC