I've just noticed an unexpected behavior with text-indent, and I'm wondering if 
it's a bug, or if I'm just misunderstanding the spec (my guess is the latter).

I have the following, for an FAQ:

<dl class="qanda">
   <dt>What is the first question?</dt>
   <dd>
      <p>This is the first paragraph of a long answer.</p>
      <p>This is the second paragraph of a long answer.</p>
   </dd>
</dl>

With CSS like so:
.qanda dt:before {
  content: "Q: ";
}

.qanda dd:before {
  content: "A: ";
  margin-left: 1.5em;
  text-indent: -1.5em;
}

Which results in the following output:

Q: What is the first question?
A: This is the first paragraph
   of a long answer.

This is the second paragraph
   of a long answer.

and, of course, what I was expecting was:

Q: What is the first question?
A: This is the first paragraph 
   of a long answer.

   This is the second paragraph
   of a long answer.

The spec says: 
>This property specifies the indentation of the first line of text in a block. 
>More precisely, 
> it specifies the indentation of the first box that flows into the block's 
> first line box. The 
> box is indented with respect to the left (or right, for right-to-left layout) 
> edge of the line 
> box. User agents should render this indentation as blank space.

In my mind, this should then apply to the first line of text in the <dd>, but 
it appears to apply to the first line of text in the <p>'s...  Why?

---Tim
______________________________________________________________________
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to