This is in reference to
http://bugzilla.mozilla.org/show_bug.cgi?id=168782
I read http://www.w3.org/TR/REC-CSS1 and I'm fairly sure the answer
is yes, but I'd appreciate confirmation from serious CSS gurus.
-F.
> According to official W3C specs, if a page has the following CSS:
> body { text-indent: 4px; }
> should the first line of a td (that contains an image) be indented?
No. The text-indent property is inherited, but it applies to block
level elements only, and td elements are not block level.
> I read http://www.w3.org/TR/REC-CSS1 and I'm fairly sure the answer
> is yes, but I'd appreciate confirmation from serious CSS gurus.
The current specification is CSS2. The relevant part is
http://www.w3.org/TR/REC-CSS2/text.html#propdef-text-indent
And there is no change from CSS1 in this issue.
--
Yucca, http://www.cs.tut.fi/~jkorpela/
Are you sure? AFAIK, "block-level" element doesn't only mean elements
with |display: block|.
See: <URL:http://www.w3.org/TR/REC-CSS2/visuren.html#q5>
"Block-level elements are those elements of the source document that are
formatted visually as blocks (e.g., paragraphs). Several values of the
'display' property make an element block-level: 'block', 'list-item',
'compact' and 'run-in' (part of the time; see compact and run-in boxes),
and 'table'."
I think that the above list isn't exclusive and stuff like inline-block
and table-cell should be counted in, too.
--
Mikko
> See: <URL:http://www.w3.org/TR/REC-CSS2/visuren.html#q5>
>
> "Block-level elements are those elements of the source document
> that are formatted visually as blocks (e.g., paragraphs).
It is indeed vague, and it's unfortunate that such an essential concept
that has formal significance (when evaluating conformance of a browser
as regards to obeying the "Applies to" rules) is defined using an
intuitive description only - which is far from being intuitively clear.
(Consider a typical numerical table, for example: cells contain numbers
or short header words or phrases - would you call the "blocks" in the
same sense as we're supposed to regards paragraphs as blocks?)
> Several
> values of the 'display' property make an element block-level:
> 'block', 'list-item', 'compact' and 'run-in' (part of the time; see
> compact and run-in boxes), and 'table'."
>
> I think that the above list isn't exclusive and stuff like
> inline-block and table-cell should be counted in, too.
More vagueness - but there's no direct indication of the list _not_
being a complete list of values, which would be the natural
interpretation. (There is no "e.g." or "such as".)
I still think the interpretation that text-indent is not inherited by
table cells is the correct one. I'd say it's the intended
interpretation, since it would be unnatural to want to have first-line
indents table cell contents just because an enclosing element has the
text-indent property set. (If a table cell contains, say, a <p>
element, then it's a different thing, but then text-indent applies to
the p element - it's inherited via the td element but it does not apply
to the td element.)
--
Yucca, http://www.cs.tut.fi/~jkorpela/
FWIW, I can't duplicate the reported behaviour (from 168782) in 1.3a.
I've played around with the attached 'test case' a fair bit without any
success.
--
I am thankful for laughter,
except when milk comes out of my nose.