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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:44:31+00:00 2026-05-28T04:44:31+00:00

Please consider the following: http://jsfiddle.net/CASM6/9/ I have two rows of tabs. there are two

  • 0

Please consider the following: http://jsfiddle.net/CASM6/9/

I have two rows of tabs. there are two tabs in the first row and 3 tabs in the second row. I want all these tabs to neatly fall inside one rectangle, with the outer borders to match perfectly. If there were no borders, this would be easy. The width for the upper tabs would be 50%, and the width for lower tabs would be 33.333333%. But the lower tabs have borders. And the width of these borders messes things up. How do I achieve the desired result? Thanks!

  • 1 1 Answer
  • 1 View
  • 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-28T04:44:32+00:00Added an answer on May 28, 2026 at 4:44 am

    This is probably not what you want to hear, but if you want to mix percentages and px you will have the easiest time by adding an extra wrapper element. That is, if you want to be accurate.

    I wrapped your li content in a div, and set the border on the div instead.

    Demo: http://jsfiddle.net/CASM6/13/

    <ul>
        <li id='left-btm'><div>Bottom 1</div></li>
        <li><div>Bottom 2</div></li>
        <li id='right-btm'><div>Bottom 3</div></li>
    </ul>  
    
    #bottom li {
        background-color:red;
        width:33.33%; /* as close as we can get to 1/3... */
    }
    
    #left-btm div, #right-btm div
    {
        border-left-color:black;
        border-right-color:black;   
        border-left-width:medium;
        border-right-width:medium;
        border-left-style:solid;
        border-right-style:solid;
    }
    
    • Here it is with a 50em http://jsfiddle.net/CASM6/21/
    • Here it is with a 3em container: http://jsfiddle.net/CASM6/20/
    • And a 49% container: http://jsfiddle.net/CASM6/19/

    Besides that 0.1% leftover from splitting the container into imperfect thirds, the layout is pixel perfect in each example. You can compensate for that by setting a background-color on the container that matches the border.

    You can fiddle around with fractions of ems and percentages all day, but you can never get them perfect because they are relative widths, unlike px. This might work if you know the exact pixel width of your container, but then if that’s the case you could have just used px unites to measure everything. This method ensures accuracy at any width.

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

Sidebar

Related Questions

please see: http://jsfiddle.net/4Z4fQ/19/ consider the following html: <a id=myElement href=http://www.google.com/> <img id=image src=http://www.google.com/intl/en_com/images/srpr/logo3w.png alt=google/>
Please consider the following three .NET types: I have an interface, an abstract class,
Consider the following code ( http://jsfiddle.net/FW36F/1/ ): <input type=checkbox onchange=alert(this.checked)> <button onclick=document.getElementsByTagName('input')[0].checked=!document.getElementsByTagName('input')[0].checked;>toggle</button> If you
please consider the following scenario for .net 2.0: I have an event that is
I want the following requirement. But there is slight change on it. http://acrisdesign.com/demo/toggle/ Please
please consider the following: I have a queue of objects represented as an array.
Please consider the following URLs: http://www.mydomain.com/a/test.php https://www.mydomain.org/a/b/test.php http://www.mydomain.co.nr/a/b/c/test.php https://www.mydomain.com/a/b/c/d/test.php http://www.mydomain.co.uk/a/b/c/d/e/test.php https://www.mydomain.co.au.nm/a/b/c/d/e/f/test.php?var1=test1&var2=test2 Now I want
Please consider the following code: <!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd> <html
Please consider following snippet: <div class=row> <div class=span12> <div class=control-group> <label class=control-label>Person Name</label> <div
Please consider the following scenario. I have a form with a property: class MyForm

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.