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 9317179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T02:48:40+00:00 2026-06-19T02:48:40+00:00

I have a list where the numbering is positioned inside each list item. Each

  • 0

I have a list where the numbering is positioned inside each list item. Each list item contains floated content, either floated left or right. The problem is that the list numbering is being rendered to the RIGHT of the first left-floated element, when the numbering is intended to be the first thing on each line.

Here is a working example of the issue. I found the issue to be happening in Chrome, Firefox, and IE9 (haven’t tested other browsers). I’ve also included the relevant code below.

HTML:

<ol>
    <li>
        <div class="name">Fingers</div>
        <div class="count">10</div>
    </li>
    <li>
        <div class="name">Arms</div>
        <div class="count">2</div>
    </li>
    <li>
        <div class="name">Heads</div>
        <div class="count">1</div>
    </li>
</ol>

CSS:

ol {
    list-style: decimal inside none;
}

ol li .name {
    float: left;
    width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

ol li .count {
    float: right;
    text-align: right;
    width: 30px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

Edit: Per my comment below, it is important that the numbering remain INSIDE the list item. The reason is that I want borders between each list item, and I want the numbering to be within the frame of the border, not outside of it.

  • 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-06-19T02:48:42+00:00Added an answer on June 19, 2026 at 2:48 am

    UPDATED:

    ol li {
      padding: 4px;
      border-bottom: 1px solid #ccc;
    
    }
    
    ol {
        list-style: decimal inside;
    }
    
    ol li .name {
        display: inline-block;
        vertical-align: text-bottom;
        width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    ol li .count {
        display: inline-block;
        vertical-align: text-bottom;
        text-align: right;
        width: 30px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have list items, with a span, set to inline-block and floated right. This
I have an ordered list (ol) on my page but the numbering is not
i have list of rows that user select and i want to delete them,
I have an ordered list which uses large Georgia for the numbering and smaller
I have an adjacent list hierarchy model that makes up a topic structure ID
I need a nested list with subitem numbering, like this: 1. Item 1 1.1
I have list of rows that I have fetched using mysql_fetch_array() . Now I
I have a table that has date and datasize. When I export the list
I have list of images. what i want that when user clicks on one
I have list (array list)that can contain many instances (between 500-3000 instances ). during

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.