LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Numbered headings in XHTML (https://www.linuxquestions.org/questions/programming-9/numbered-headings-in-xhtml-350284/)

vharishankar 08-05-2005 11:10 AM

Numbered headings in XHTML
 
How can I produce automatically numbered headings using the <h1> to <h6> tags in XHTML? I have tried searching for this, but I cannot seem to find out the way to achieve this.

That is to say

Code:

1. Heading level 1
 1.1 Heading level 2
 1.2 Heading another
2. Heading another
 2.1 Another subheading
  2.1.1 Yet another subheading

I have seen this somewhere, but I forget where... Can anybody help me?

slacky 08-05-2005 01:19 PM

I've seen this in the CSS specs:

http://www.w3.org/TR/CSS21/generate.html#counters

Is that what you're looking for?

Josh

vharishankar 08-05-2005 11:07 PM

I tried that, but it didn't work. Maybe I'm missing something. Anybody has any examples of this?

Thanks.

scuzzman 08-05-2005 11:50 PM

You're looking for an ordered list. There's a tutorial here: http://www.w3schools.com/html/html_lists.asp
Your exact answer is here: http://www.w3schools.com/html/tryit...._lists_ordered

vharishankar 08-06-2005 01:41 AM

scuzzman, no. I'm not looking for ordered lists. As a matter of fact, I am quite proficient in using those ;)

In this case what I'm looking for is headline numbering. That is numbered chapters and sections using <h1> to <h6> tags to write using numbered chapters rather than un-numbered chapters.

That is I want to organize my page into chapters
Code:

1. Title of chapter 1

text goes here

1.1 Section title

text goes here

1.2. Section title

text goes here

1.2.1 Another subsection

text goes here

That is I want numbering for my headings. Not an ordered list but for my main headings.

Hope that clarifies my question.

XavierP 08-06-2005 05:56 AM

As requested, moved to programming

vharishankar 08-07-2005 01:12 AM

For those interested I found that this CSS 2.1 technology (automatic numbering of heading sections) is unfortunately still poorly supported/unsupporte by most browsers other than opera.

It seems to be an older page, so I am not sure of Firefox.
Check here
http://www.markschenk.com/cssexp/pub...le.xml#support


All times are GMT -5. The time now is 02:47 PM.