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

Re: Issue 4: Text-Indent and DIV

From: David Perrell <davidp@earthlink.net>
Date: Sun, 3 Aug 1997 11:39:53 -0700
Message-Id: <199708031843.LAA25394@denmark.it.earthlink.net>
To: <www-style@w3.org>, "E. Stephen Mack" <estephen@emf.net>
E. Stephen Mack wrote:
> ...
> I expected each paragraph to have the indented first line
> as well as 0 height in the top margin.  Instead, only the
> first line of the first paragraph has the rules. The
> second and subsequent paragraphs are not indented and have
> the normal full paragraph break (in IE 4.0pp2, Navigator
> 4.01, and IE 3.)

The text-indent property is inherited from its parent. DIV is the
parent. So each P in your example should have an indent, unless
text-indent for P is explicitly declared as 0 in the reader/browser
style sheet, in which case no P should have a text-indent.

Margin is not inherited. The top margin of P should be the same
throughout, and in my own test, NSN4.01 appeared to handle the top
margin on P correctly when all other margins were set to 0. You have to
consider how margins collapse when analyzing the rendering. P seems to
have a default margin-bottom in all UAs. So that this:
   ...
   BODY {
     margin: 0 }
   DIV {
     margin: 0}
   P {
     margin-top: 0 }
   ...
   <BODY>
   <DIV>
   <P>Some text blahbitty blahbitty blah.
   <P>Some text blahbitty blahbitty blah.

Will give a zero margin at the top of the first paragraph, but the
default bottom margin of P will give interparagraph spacing prior to
each subsequent paragraph.

> Nothing here defines "first formatted line" -- if each element
> has its own "first" line, or if an entire group only has one
> "first" formatted line.

As regards the rendering of your example, it doesn't matter. The
property is inherited by every P, and the first formatted line of each
P is the first line of the element itself. Text-indent should not be
cumulative, so even if your second interpretation is correct, all child
paragraphs should have the same text-indent.

What if P has text-indent declared as 0 in the client-side stylesheet?
In that case, even with your second interpretation the declared
properties of P should override values inherited from DIV, and there
should be no indent on any of the paragraphs.

The browsers are not treating text-indent as inherited, as the spec
clearly states they should. Worse, the text-indent of the parent DIV is
being applied to the child P even when the property has been explicitly
set on the child. This is just plain wrong. Worse yet, in NSN 4.01,
text indent is cumulative. The text-indent on the first line of the
first paragraph is the sum of the text-indent of DIV and P. This is
just plain abominable.

Perhaps the description in 5.4.7 of the Recommendation should be
changed to:

"The property specifies the indentation of the first line of text
relative to the horizontal edge of the element's content. The
indentation forms a blank space between the edge of the content and the
first character of the first line. The property does not apply directly
to text in a child element, however it will apply through inheritance
if the property is not explicitly declared for the child. The value of
'text-indent' may be negative, but there may be implementation-specific
limits. An indentation is not inserted when a line of text is broken by
a child element (such as 'BR' in HTML)."

David Perrell
Received on Sunday, 3 August 1997 14:43:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:51 GMT