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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:59:17+00:00 2026-05-23T16:59:17+00:00

Whenever I have two elements side by side horizontally with right and/or left padding

  • 0

Whenever I have two elements side by side horizontally with right and/or left padding and/or margin specified, there is often space between the elements over and above what I’ve specified. I’m hoping someone can tell me how to eliminate that space (without something crufty like a negative margin).

Please note: I am not looking for alternative multi-column CSS layout techniques. I know there are loads of them out there and this issue is bigger than just a column layout issue.

Below is the markup and styles for a working example page. Here’s a partial screenshot of that page that shows left elements selected with Firebug. The mysterious space in question is to the right and is marked with a red asterisk. There are no reset styles included but I’ve plugged in Eric Meyers’ reset and it didn’t solve the problem.

    <div id="side-a"> 
           <p>
        Lorem ipsum ....
        </p> 
    </div> 
    <div id="side-b"> 
           <p>
        Nunc dapibus....
        </p> 
    </div>

    <div id="website-footer"> 
           <ul id="legal-information"> 
                  <li>Copyright 2011</li> 
                  <li><a href="#">Privacy Policy</a></li> 
           </ul> 
    </div>

    div#side-a,
    div#side-b {
        display: inline-block;
        width: 200px;
        padding: 17px 17px 0;
    }

    div#side-a {
           vertical-align: top;
    }

    div#side-b {
           background: #999;
    }

    ul {
           padding-bottom: 17px;
           list-style: none outside none;
    }

    ul li {
           line-height: 17px;
           margin-left: 17px;
    }

    div#website-footer ul#legal-information {
           float: left;
    }

    div#website-footer ul#legal-information li {
           border-left: 1px solid #29443C;
           display: inline;
           margin: 17px 0;
           padding-left: 8px;
    }

    div#website-footer ul#legal-information li:first-child {
           border-left: medium none;
           padding: 0 8px 0 0;
    }
  • 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-23T16:59:18+00:00Added an answer on May 23, 2026 at 4:59 pm

    It’s natural because of inline-block. Simple solution is to kill whitespace.

    http://work.arounds.org/issue/6/unwanted-white-space-between-inline-block-elements/

    There are other css based workarounds such as setting a font size of 0 on the body, but AFAIK they aren’t as consistent/reliable. I could be wrong though.

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

Sidebar

Related Questions

I have two UIImageViews, one of them is moving from left to right, the
I have two divs. One on the left and one on the right. The
I Have two files. One extends JFrame, and another Extends JPanel. Whenever I change
I have two text fields and whenever I write a number in the first
I have two datepickers: $('#Date1, #Date2').datepicker({ defaultDate: +1, minDate: +1 }); Whenever I select
I have two search options: 1. On Master Page there is a text box
Swapping two elements whenever one element dragged and dropped over another element. I used
i have two tabs tabfirst, tabsecond. whenever i select a tab(first or second) i
I have these two elements in my page: <input type='button' value=undo style=display:none onClick =
Whenever I have a library that use across different websites/ applications I've always just

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.