SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict
    Join Date
    Sep 2004
    Location
    Camas, WA (USA)
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    <ol> start & <li> value within CSS

    Everywhere I've searched has brought me the same answer...the "start" and "value" attributes for <ol> and <li> are deprecated. Great, but what is the alternative? What happens if you want to start a list on a different number?

    The example below seems to be a good illustration. It's a standard list occupying two visual columns.

    HTML Code:
    <style>
    .firstcolumn {
    	float: left;  
    	width: 9em; 
    	list-style-position: inside; 
    	border: 1px dotted red;
    	margin-top: 0.5em; 
    	margin-left: 1em;
    	}
    .secondcolumn {
    	list-style-position: inside; 
    	width: 9em; 
    	border: 1px dotted red;
    	margin-top: 0.5em; 
    	margin-left: 12em;	
    	}
    </style>
    
    <ol class="firstcolumn">
      <li>one</li>
      <li>two</li>
      <li>three</li>
      <li>four</li>
    </ol>
    <ol class="secondcolumn">
      <li>five</li>
      <li>six</li>
      <li>seven</li>
      <li>eight</li>
    </ol>
    Using deprecated tags, I could either add 'start="5"' to the secondcolumn <ol> or add 'value="5"' to the <li> containing the word "5". Both have the same result. What is the CSS alternative?

  2. #2
    SitePoint Guru bronze trophy blufive's Avatar
    Join Date
    Mar 2002
    Location
    Manchester, UK
    Posts
    853
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Theoretically, there are CSS Counters (http://www.w3.org/TR/CSS2/generate.html#counters) but browser support was lousy last time I looked (Kudos to Opera, who do support them)

    For the moment, I think you've got to use the deprecated tags.

  3. #3
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    I think you can still use the start and value attributes in XHTML Transitional. I suggest doing that rather than trying to trawl through the horrible browser support for CSS list counters.

  4. #4
    SitePoint Addict
    Join Date
    Sep 2004
    Location
    Camas, WA (USA)
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for the quick answers...i'll look into css counters for the future, but for now...deprecation it is


Bookmarks

Posting Permissions

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