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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T08:47:05+00:00 2026-06-02T08:47:05+00:00

If you have a parent container set to width: 100% and you have sections

  • 0

If you have a parent container set to width: 100% and you have sections within that are all supposed to be equal, but the percentage is an odd number, like 16.666667%, how do you ensure it displays correctly with no breaks? What’s the limit to decimal places?

Example:
You have

<ul>
     <li>One
     <li>Two
     <li>Three
     <li>Four
     <li>Five
     <li>Six
</ul>

and the ul has a width of 100%, all the li are floated left. Now dividing 100 by 6 you get 16.66666666667%. If i wanted a border-right: 1px solid black; how do you factor these things in with the CSS? I can understand it’s all math, but you can’t minus 1px from a percentage (as far as I can imagine, maybe you can…)

So how do you do these things? Thanks!

  • 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-02T08:47:14+00:00Added an answer on June 2, 2026 at 8:47 am

    Hey i think you want this you can define your ul display:table and define you ul li to display:table-cell; as like this

    Css

    div{
    width:500px;
        border:solid 1px red;
        margin:0 auto;
    
    }
    
    ul{
    width:100%;
        background:green;
        display:table;
    
    }
    
    ul li{
    display:table-cell;
        border-right:solid 1px white;
        padding:10px;
    }
    ul li:last-child{border:none;}
    ​
    

    HTML

    <div>
    <ul>
        <li>One</li>
         <li>Two</li>
         <li>Three</li>
         <li>Four</li>
         <li>Five</li>
         <li>Six</li>
    </ul>
    </div>
    ​
    

    Live demo http://jsfiddle.net/rohitazad/gjutz/1/

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

Sidebar

Related Questions

How can I set DOP_ThumbnailGallery_Container to have the width of the parent container $('.DOP_ThumbnailGallery_Container',
I have a parent grid that contains multiple row definitions, all of which have
I have a container div (it has both width an height set in pixels).
I have a jquery scrollable that is not constrained to be within it's parent.
I have a combobox with a width set to 100%. However, when one of
I have a parent div (container) that has a child div (inner) which also
Is there a way to have a child DIV within a parent container DIV
I have a div that I want to set to 90% of its parent
I have a parent class which contains a child object. I am using set
How would I setup my controls for the following situation?: I have a parent-container

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.