Issue 4: Text-Indent and DIV

Suppose I have the following rule in a style sheet:

DIV.fiction {
       text-indent: 5%; 
       margin-top: 0em;
       margin-left: 22%;
       margin-right: 11%;
}

Then suppose I use
<DIV CLASS="fiction">[bunch of <P>blah blah blah elements]</DIV>

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 CSS1 specification's description of text-indent is unclear
to me in this regard [1]:

5.4.7    'text-indent' 

Value: <length> | <percentage>
Initial: 0
Applies to: block-level elements
Inherited: yes
Percentage values: refer to parent element's width

The property specifies the indentation that appears before the first
formatted line. The value of 'text-indent' may be negative,
but there may be implementation-specific limits. An indentation is not
inserted in the middle of an element that was broken by
another (such as 'BR' in HTML). 

Example: 

  P { text-indent: 3em }

--------end-excerpt-------

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.

I would have expected that each subsequent P element would inherit
the text-indent property as long as it was still within the
DIV element, so that every paragraph in my document would be
indented.  But for all three CSS1-enabled browsers, it's not so.

Am I right here, or are three browsers' implementations proof
that I have it wrong?

If I place the text-indent rule as a BODY selector, then
again, only the first line of the document is indented,
not each paragraph in the document.

However, if I place the text-indent rule as a P selector,
then each paragraph element re-instantiates the declaration
and is indented.

HTML 4.0's specification on style sheets and DIV doesn't offer
me any evidence one way or another of what should be happening
here.

[1] http://www.w3.org/pub/WWW/TR/REC-CSS1#text-indent
-- 
E. Stephen Mack <estephen@emf.net>    http://www.emf.net/~estephen/

Received on Sunday, 3 August 1997 05:14:03 UTC