Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 8 of 8

Thread: [css] Using decimals in Ordered Lists

  1. #1

    [css] Using decimals in Ordered Lists

    Hey all, Trying to update a old website with some css coding and got a little stuck on the ordered lists.

    Currently they are just manually entered, eg.. 3.1, 3.2, 3.3...........3.10.

    I was trying to work out how to get that same structure using ordered lists. (ol) but have not been successful as of yet.

    The following is a simplified structure i have.

    css//

    ol{list-style-type:decimal;}


    xhtml//
    <ol start="3">
    <ul>blah</ul>
    <ul>blah</ul>
    <ul>blah</ul>
    </ol>

    I also found i could use decimal-leading-zero, but that give me 01, 02, 03, and not 3.1 , 3.2 .. also require it to start on 3 and later on 11.

    ::fyi:: i passed this by simp and he found a w3 doc that uses manually entered 2.1.1 in a ul list. By seeing that we both believe its probably something css cannot do by thought i would pass it by you guys/girls anway

    if anyone can help that would be great,
    cheers.

  2. #2
    Yeah I couldnt find the real solution either..
    Just using nested <ol>'s might help? (gives indented numbers for second level)
    <ol>
    <li>dfgdhsldjks</li>
    <li>dfgdhsldjks</li>
    <ol>
    <li>dfgdhsldjks</li>
    <li>dfgdhsldjks</li>
    </ol>
    <li>dfgdhsldjks</li>
    <li>dfgdhsldjks</li>
    </ol>


    R

  3. #3
    well actually it would be more like
    HTML Code:
    <ol>
      <li>Main Item 1
        <ol>
        <li>Sub Item 1.1</li>
        <li>Sub Item 1.2</li>
        <li>Sub Item 1.3</li>
        </ol>
      </li>
        <li>Main Item 2
        <ol>
        <li>Sub Item 2.1</li>
        <li>Sub Item 2.2</li>
        <li>Sub Item 2.3</li>
        </ol>
      </li>
    </ol>
    Let us live so that when we come to die even the undertaker will be sorry. - Mark Twain
    Don't PM me your CSS, xHTML, JS or PHP questions. I will not reply to ANY IE6 questions.

  4. #4
    thanks guys, still dosent get me a list with 3.1, 3.2.

    its all good, it dosent seem possible, simp did show me a counter-increment method which i also had read about but it dosent view in all browsers.. (*cough* ie crap *cough*).

    if theres any more ideas feel free

  5. #5
    before: { content ...} would be perfect if it displayed in IE...

  6. #6
    Quote Originally Posted by .soulty
    thanks guys, still dosent get me a list with 3.1, 3.2.

    its all good, it dosent seem possible, simp did show me a counter-increment method which i also had read about but it dosent view in all browsers.. (*cough* ie crap *cough*).

    if theres any more ideas feel free
    yea... and just anyone else that's wondering what he's talkin about
    HTML Code:
    <style type="text/css">
    <!--
    ol {counter-reset: item;}
    
    li {display: block;}
    
    li:before {
       content: counters(item, ".");
       counter-increment: item;
       padding: 5px; /*bumps the number away from the entry*/
    } 
    -->
    </style>
    but again... the problem is that it doesn't show in IE, and it actually doesn't display in Safari either
    Let us live so that when we come to die even the undertaker will be sorry. - Mark Twain
    Don't PM me your CSS, xHTML, JS or PHP questions. I will not reply to ANY IE6 questions.

  7. #7
    unlike a lot of designers, i don't get too frustrated with IE. but IE's inability to display before: { content ... } really really eats at me. it would be so useful. instead we're stuck with background images and padding-left. gah.

  8. #8
    Quote Originally Posted by bwh2
    unlike a lot of designers, i don't get too frustrated with IE. but IE's inability to display before: { content ... } really really eats at me. it would be so useful. instead we're stuck with background images and padding-left. gah.
    well... designers dont' get annoyed with it... it's the developers I'm a halfie so I get frustrated that IE has always sucked in the past... they know it has... and they continue to let it suck..
    Let us live so that when we come to die even the undertaker will be sorry. - Mark Twain
    Don't PM me your CSS, xHTML, JS or PHP questions. I will not reply to ANY IE6 questions.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012