www.webdeveloper.com
Results 1 to 3 of 3

Thread: Remove period for ordered-list numbers?

  1. #1
    Join Date
    Aug 2004
    Posts
    142

    Remove period for ordered-list numbers?

    I can't see how to do this, but it must be easy.

    According to the reference, if you use a number, it's got to have a trailing period.

    Any way to get around this?

    I mean, obviously I can just "list-style:none"--it, and then generate a number inside the <li>-tags, but that's kind of ugly.
    Homepage of Michael Purvis

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Only by adding the numbers yourself with the DOM, as you suggest.
    There is a method of doing this in css2, but only Opera supports counter
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html lang="en">
    <head>
    <title>counter</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <style type="text/css">
    <!-- 
    ul {
    list-style-type:none;
    } 
    ul li:before {
    content:counter(number) " ";
    counter-increment:number;
    }
    -->
    </style>
    
    </head>
    <body>
    <ul>
    <li>apple</li>
    <li>banana</li>
    <li>cranberry</li>
    </ul>
    </body>
    </html>
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Aug 2004
    Posts
    142
    Quote Originally Posted by Fang
    Only by adding the numbers yourself with the DOM, as you suggest.
    There is a method of doing this in css2, but only Opera supports counter
    Right, thanks.
    Homepage of Michael Purvis

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
  •  
HTML5 Development Center



Recent Articles