Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1038667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:00:14+00:00 2026-05-16T15:00:14+00:00

I want to create HTML nested lists that has the following format: 1 1.1

  • 0

I want to create HTML nested lists that has the following format:

1  
   1.1  
   1.2  
   1.3  
   1.4   
2
   2.1

I tried a solution that I found on the internet:

OL { counter-reset: item }
LI { display: block }
LI:before { content: counters(item, ".") " "; counter-increment: item }

But it didnt work for me.
Any help please??

If the counter solution is too complicated, is there a way to fake the nested list effect, by writing them manually but being sure that the formatting looks like a real list


EDIT

need full IE6 support

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:00:14+00:00Added an answer on May 16, 2026 at 3:00 pm

    This should work. It is a bad way to do this but if you MUST support IE6 not much choice.

          <ol>
            <li><span>1</span> Item
              <ol>
                <li><span>1.1</span> Item</li>
                <li><span>1.2</span> Item</li>
                <li><span>1.3</span> Item</li>
                <li><span>1.4</span> Item</li>
              </ol>
            </li>            
            <li><span>2</span> Item
              <ol>
                <li><span>2.1</span> Item</li>
              </ol>            
            </li>
          </ol>
    

    with css

    ol {list-style:none;}
    

    After your comment I’ve redone it a bit.

      <ol>
        <li><span>1</span> Item
          <ol>
            <li><span>1.1</span> <p>ItemItemItem ItemItemItemItemItemItemItemItem ItemItemItemItemItemItemItemItem ItemItemItemItemItemItemItemItem</p></li>
            <li><span>1.2</span> <p>ItemItemItem ItemItemItemItemItemItemItemItem ItemItemItemItemItemItemItemItem ItemItemItemItemItemItemItemItem</p></li>
            <li><span>1.3</span> <p>ItemItemItem ItemItemItemItemItemItemItemItem ItemItemItemItemItemItemItemItem ItemItemItemItemItemItemItemItem</p></li>
            <li><span>1.4</span> <p>Item</p></li>
          </ol>
        </li>            
        <li><span>2</span> Item
          <ol>
            <li><span>2.1</span> Item</li>
          </ol>            
        </li>
      </ol>
    

    And the css would be

    ol {list-style:none;}
    ol li span
    {
      display: block;
      float: left;
      width: 30px;
    }
    ol li
    {
     clear:both;
     width: 400px;
    
    }
    ol li p
    {
      float: left;
      width: 370px;
      margin: 0;
    
    }
    

    You may have to adjust the widths.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a html table with a 1pt black outer border and
I want to create a toggle button in html using css. I want it
I want to create a very simple HTML/AJAX based GUI for a Python program.
So I have Html like this http://trac.edgewall.org/wiki/RecentChanges (I want to create some Flash Track
I have a website which uses PHP and HTML pages, I want to create
I want to use nokogiri to loop through a html and create an object
I am using the Html.TextBox helper to create textboxes. I want to set attributes
i want create image animation , i have 50 images with png format now
I want to create html page using php code form c:\www\test\script\new\creat_html.php to c:\www\test\html\index.html .
I want to create an html page with a watermark. I set the background-image

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.