W3C home > Mailing lists > Public > www-style@w3.org > March 1999

Question: Identation based on first child, how?

From: Alix Pexton <T.A.N.Pexton@scm.brad.ac.uk>
Date: Mon, 15 Mar 1999 04:44:15 -0500 (EST)
Message-ID: <Pine.SOL.4.02A.9903150924390.2620-100000@dcsun2.comp.brad.ac.uk>
To: www-style@w3.org

Hi...

I have a specification document in HTML where each sub-part uses the next
smallest heading than the last, a standard form I believe. Each subpart is
its own DIVision, (child of the body element), with the heading and a
number of paragraphs. I want to have it so each level of sub-part was
subtly more indented than its parent, and use CSS to do it.

I was trying to figure out a way to indent a division bassed on what the
first tag inside it was, i.e. if the first tah was <h1> no indent, <h2> 
2 pixels and so on, but I couldn't get it to work. As far as I can
see it would either be the oposite of the > selector in CSS2 (< ?) or
mabe the oposite of the + selector also in CSS2 (- ?), but I cannot find a
way to perform the exact formatting I require.

Is there a simple way to achieve this style of formating, or a subtly more
complex one, or will I have to restructure my documents, which are quite
lengthy and I don't really want to have to change.

All help appreciated...

Alix Pexton...

   ----------------~~~~ Alix Pexton ~~~~--------------
   --------~~~ t.a.n.pexton@scm.brad.ac.uk ~~~--------
   ---~~ http://www.student.brad.ac.uk/tanpexto/ ~~---
   "If you are falling off a mountain, you may as well
try to fly, after all, you have nothing to loose" JJS(JMS)
   ---------------------~~~~*~~~~--------------------
                        _+-~^~-+_
Received on Monday, 15 March 1999 06:10:24 GMT

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