Reply
OL CSS and 4.1.2 formatting
Old 07-22-2008, 02:25 PM OL CSS and 4.1.2 formatting
JeremyMiller's Avatar
Full-Time TeraTasker

Posts: 1,648
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
How do I modify CSS to allow formatting which understands the indentation level to make numbers of the format x.y.z....?

For example,

Code:
1. Top Level.
  1.1 Secondary Level
  1.2 Another secondary level.
    1.2.1 Tertiary level
I've been trying to modify this from XHTML like this:


Code:
<ol>
  <li>Top Level.
    <ol>
      <li>Secondary Level</li>
      <li>Another secondary level.
        <ol>
          <li>Tertiary level</li>
        </ol>
      </li>
    </ol>
  </li>
</ol>
TK will be given for any help and you, of course, have my sincere appreciation.
__________________
Jeremy Miller - TeraTask
Content Farmer - Automated Posting for Content & Blog Sites
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
 
When You Register, These Ads Go Away!
Old 07-22-2008, 03:03 PM Re: OL CSS and 4.1.2 formatting
LadynRed's Avatar
Super Moderator

Posts: 9,392
Location: Tennessee
Trades: 0
Define the style type:
ol.decimal {list-style-type: decimal}
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-22-2008, 03:15 PM Re: OL CSS and 4.1.2 formatting
JeremyMiller's Avatar
Full-Time TeraTasker

Posts: 1,648
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Thanks Lady. I gave that a shot with this code:

HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <style type="text/css">
    ol.decimal {list-style-type: decimal}
    </style>
  </head>
  <body>
  <ol class="decimal">
    <li>Top Level.
      <ol class="decimal">
        <li>Secondary Level</li>
        <li>Another secondary level.
          <ol class="decimal">
            <li>Tertiary level</li>
          </ol>
        </li>
      </ol>
    </li>
  </ol>
  <ol>
    <li>Top Level.
      <ol class="decimal">
        <li>Secondary Level</li>
        <li>Another secondary level.
          <ol class="decimal">
            <li>Tertiary level</li>
          </ol>
        </li>
      </ol>
    </li>
  </ol>
  <ol>
    <li>Top Level.
      <ol>
        <li>Secondary Level</li>
        <li>Another secondary level.
          <ol>
            <li>Tertiary level</li>
          </ol>
        </li>
      </ol>
    </li>
  </ol>
  </body>
<html>
and I'm getting (for all 3 OLs)
Code:
1. Top Level.
  1. Secondary Level 
  2. Another secondary level. 
    1. Tertiary level
Did I misunderstand?

Oh and in my first example I forgot the trailing periods -- they're fine. I'm more interested in retaining the parent number. So, the correct way should be

Code:
1. Top Level.
  1.1. Secondary Level
  1.2. Another secondary level.
    1.2.1. Tertiary level
Thanks again and, as promised, TK's coming your way.
__________________
Jeremy Miller - TeraTask
Content Farmer - Automated Posting for Content & Blog Sites

Last edited by JeremyMiller; 07-22-2008 at 03:38 PM..
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 07-22-2008, 03:40 PM Re: OL CSS and 4.1.2 formatting
LadynRed's Avatar
Super Moderator

Posts: 9,392
Location: Tennessee
Trades: 0
Yes.. ordered lists like that are a problem. I've never tried this method, but you might want to give it a shot:

http://www.w3.org/TR/REC-CSS2/generate.html#counters
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-22-2008, 03:41 PM Re: OL CSS and 4.1.2 formatting
JeremyMiller's Avatar
Full-Time TeraTasker

Posts: 1,648
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Thanks. I will and will report back here on what I figure out.
__________________
Jeremy Miller - TeraTask
Content Farmer - Automated Posting for Content & Blog Sites
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 07-22-2008, 03:50 PM Re: OL CSS and 4.1.2 formatting
JeremyMiller's Avatar
Full-Time TeraTasker

Posts: 1,648
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
This did it:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <style type="text/css">
    OL { counter-reset: item }
    LI { display: block }
    LI:before { content: counters(item, ".") " "; counter-increment: item }

    </style>
  </head>
  <body>
  <ol>
    <li>Top Level.
      <ol>
        <li>Secondary Level</li>
        <li>Another secondary level.
          <ol>
            <li>Tertiary level</li>
          </ol>
        </li>
      </ol>
    </li>
    <li>Top Level.
      <ol>
        <li>Secondary Level</li>
        <li>Another secondary level.
          <ol>
            <li>Tertiary level</li>
          </ol>
        </li>
      </ol>
    </li>
  </ol>
  </body>
<html>
__________________
Jeremy Miller - TeraTask
Content Farmer - Automated Posting for Content & Blog Sites
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 07-22-2008, 04:17 PM Re: OL CSS and 4.1.2 formatting
LadynRed's Avatar
Super Moderator

Posts: 9,392
Location: Tennessee
Trades: 0
Coolness
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-22-2008, 07:42 PM Re: OL CSS and 4.1.2 formatting
vangogh's Avatar
Post Impressionist

Latest Blog Post:
Is Design A Commodity?
Posts: 10,085
Name: Steven Bradley
Location: Boulder, Colorado
Trades: 0
Nice. Sorry I missed the Q&A portion of the game, but it's good to know how to do this. Thanks.
__________________
l Search Engine Friendly Web Design | Van SEO Design
l Tips On Marketing, SEO, Design, and Development | TheVanBlog
l Custom WordPress Themes
| Small Business Forum
vangogh is offline
Reply With Quote
View Public Profile Visit vangogh's homepage!
 
Reply     « Reply to OL CSS and 4.1.2 formatting
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11499 seconds with 13 queries