Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
OL CSS and 4.1.2 formatting
Old 07-22-2008, 03:25 PM OL CSS and 4.1.2 formatting
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
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

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
 
Register now for full access!
Old 07-22-2008, 04:03 PM Re: OL CSS and 4.1.2 formatting
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Define the style type:
ol.decimal {list-style-type: decimal}
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-22-2008, 04:15 PM Re: OL CSS and 4.1.2 formatting
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
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

Please login or register to view this content. Registration is FREE

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

Posts: 10,016
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 !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-22-2008, 04:41 PM Re: OL CSS and 4.1.2 formatting
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Thanks. I will and will report back here on what I figure out.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 07-22-2008, 04:50 PM Re: OL CSS and 4.1.2 formatting
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
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

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 07-22-2008, 05:17 PM Re: OL CSS and 4.1.2 formatting
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
Coolness
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-22-2008, 08:42 PM Re: OL CSS and 4.1.2 formatting
vangogh's Avatar
Post Impressionist

Posts: 10,688
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 |
Please login or register to view this content. Registration is FREE

l Tips On Marketing, SEO, Design, and Development |
Please login or register to view this content. Registration is FREE

l
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
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.28395 seconds with 12 queries