CSS2 was RE: [thelist] Aimster must give up domain to AOL

Ron White ronwhite at members.evolt.org
Mon May 21 14:52:20 CDT 2001

Will this work if there are any other tags in the paragraphs?? Or do you
have to give up using any other tags for this to work?

Ron White

<tip>If you want to make the first paragraph in a sequence have no indent,
with the following paragraphs having an indent, *and* you don't want to use
lot of nasty class attributes to do it, CSS2 contextual selectors provide an
easy way. The E+F type selector (select element F immediately preceded by
element E) Is a really easy way to do this:

P { font: 12pt/18pt a font; text-indent: 0; }
P+P { text-indent: 12pt; }

The P+P selector will select all <P> tags that are immediately preceded by a
tag, which is all <P> tags except the first in a sequence. i.e.
<h2>head</h2><p>first para</p><p>next para</p><p>more para</p>.

Since the first para is immediately preceded by an <H2> the P+P selector
match it, so its text-indent remains zero.

More information about the thelist mailing list