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

  • Home
  • SEARCH
  • 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 script that does the following: When answering questions via
I want to create an inline-block that will take on some unknown width and
If I create an HTML element: sc { font-variant: small-caps; } and apply it
I want to create a dropdownlist in my asp.net MVC2 view and I am
I have the following html button <td><form id=form2 name=form2 method=post onclick=../cgi-bin/py/GuestBookEntry.py> <input type=submit name=gBookSrib
I am trying to make this function that extracts text from html for multiple
I have following code in my MVC2 view: <tr class=edit style=display:none> <td> <%= Html.DropDownList(drpFields,
I have following code in my MVC2 view: <tr class=edit style=display:none> <td> <%= Html.DropDownList(drpFields,
Is there any way to create a modal 'scope' for jQuery dialogs? As a
I'm trying to figure out how to upload an image and get user input

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.