Grow your CSS skills. Land your dream job.

numbered list divided by title

  • # May 29, 2008 at 2:32 pm

    Hi!
    Here is my problem :
    I have a very long legal document to put on the web. That document should respect that format:

    Quote:
    TITLE
    1. bla bla bla
    TITLE
    2. bla bla bla
    TITLE
    3. bla bla bla
    * subbla subbla subbla
    TITLE
    4. bla bla bla
    5. bla bla bla
    * subbla subbla subbla
    TITLE
    6. bla bla bla.
    * 6.1 subbla subbla subbla;
    * 6.2subbla subbla subbla

    I want to use the ordered list <ol> and define the TITLE as H2 elements. The problem I have is if I do this, I would have to rely on the deprecated element “start” and “value” which I would like to avoid. I could have use the counter-increment property but it doesn’t work in IE 6 and I need this page to be cross-browser compatible.
    Do you know how I can break my ordered list with those <h2> while staying cross-browser compatible and validing strict HTML?

    ***
    here is my actual code (it works but not perfect as I want to get rid of the start= element) :
    ***

    Code:
    /**css**/
    #main h2{font-weight:bold; font-size:14px; padding:0px; text-transform:capitalize;}

    #main ol {list-style-type: decimal}
    #main ol li{padding:5px 0px 5px 0px; margin:0px;}

    #main ul.subList{padding:0px; margin:0px; list-style-type:none; list-style-position: inside;}
    #main ul.subList li{padding:5px 0px 5px 0px; margin:0px; list-style: none;}

    /**html**/

    TITLE

    1. bla bla bla
    2. bla bla bla

    TITLE

    1. bla bla bla

    TITLE

    1. bla bla bla
      • subbla subbla subbla

    TITLE

    1. bla bla bla
    2. bla bla bla
      • subbla subbla subbla

    TITLE

    1. bla bla bla
      • 7.1 subbla subbla subbla
      • 7.2 subbla subbla subbla

    Any help?

    # May 29, 2008 at 4:13 pm

    Better use defenitionlists i think:

    Code:
    Title
    1. blabla
    Title
    2. blabla
    Title
    3. blabla
    *subbla subbla subbla
    # May 29, 2008 at 7:29 pm

    I totally agree to Edwin

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".