Help answer threads with 0 replies.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 08-05-2005, 12:10 PM   #1
Senior Member
Registered: Dec 2003
Posts: 3,161
Blog Entries: 4

Rep: Reputation: 136Reputation: 136
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

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?
Old 08-05-2005, 02:19 PM   #2
Registered: Feb 2004
Location: USA
Distribution: Debian
Posts: 174

Rep: Reputation: 16
I've seen this in the CSS specs:

Is that what you're looking for?

Old 08-06-2005, 12:07 AM   #3
Senior Member
Registered: Dec 2003
Posts: 3,161

Original Poster
Blog Entries: 4

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

Old 08-06-2005, 12:50 AM   #4
Senior Member
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
You're looking for an ordered list. There's a tutorial here:
Your exact answer is here:

Last edited by scuzzman; 08-06-2005 at 12:52 AM.
Old 08-06-2005, 02:41 AM   #5
Senior Member
Registered: Dec 2003
Posts: 3,161

Original Poster
Blog Entries: 4

Rep: Reputation: 136Reputation: 136
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
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.

Last edited by vharishankar; 08-06-2005 at 02:46 AM.
Old 08-06-2005, 06:56 AM   #6
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 474Reputation: 474Reputation: 474Reputation: 474Reputation: 474
As requested, moved to programming
Old 08-07-2005, 02:12 AM   #7
Senior Member
Registered: Dec 2003
Posts: 3,161

Original Poster
Blog Entries: 4

Rep: Reputation: 136Reputation: 136
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

Last edited by vharishankar; 08-07-2005 at 02:15 AM.


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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
An application that allows viewing e-mail headings before downloading Ariod Linux - Software 1 09-26-2005 02:16 PM
HTML to XHTML conversion rjlee Linux - Software 3 01-10-2005 08:27 AM
Can someone recommend a good JavaScript/XHTML forum? davee General 4 10-03-2003 08:34 AM
Numbered Keypad doesn't funtion. l0f33t Linux - Hardware 1 05-25-2003 12:16 PM
do you use xhtml ? linowes General 0 01-15-2003 12:01 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:52 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration