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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:59:51+00:00 2026-06-09T23:59:51+00:00

I have two divs with same border style, have different heights and are back

  • 0

I have two divs with same border style, have different heights and are back to back to each other. I want the common border between them not to display. How can this be done in html and css?

enter image description here

  • 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-09T23:59:53+00:00Added an answer on June 9, 2026 at 11:59 pm

    A lot of people have suggested getting the smaller div to overlap the larger one and setting the left border to the same color as the background color. The problem with this is that you will get a 1px gap at the two spots where the div borders overlap:

    http://jsfiddle.net/RWz4A/

    In order to avoid this, you can explicitly remove the left border, and have a non-transparent background.

    HTML

    <div id="one"></div><div id="two"></div>​
    

    CSS

    #one, #two {
        width: 100px;
        border: 1px solid black;
        display: inline-block;
    }
    #one {
        height: 200px;
    }
    #two {
        height: 100px;
    
        position: relative;
        left: -1px;
        background: white;
        border-left: none;
    }​
    

    jsFiddle Demo

    Edit:

    As thirdender mentioned, you can also use margin-left instead of a combination of position and left. This may be a better option for you depending on your previous styling and how the elements are arranged (probably better in most cases if margin-left is not already set).

    Zach Shipley also made a good point about browser support for display: inline-block and added the following CSS:

    *display: inline;
    zoom: 1;
    vertical-align: bottom;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two sibling divs sitting below each other, both contained in the same
I currently have two divs on my site: Notice that both have border [same
I am trying to place two divs next to each-other on the same line,
I have two divs in my app and I want them to have custom
I have two divs with different ids but with the same classname. Example: Window1
i have two divs with the same ids but one has display=none and the
My issue is that I have two (or more) divs of the same class,
I have two divs floated next to one another: <div id=parent> <div id=child_1 style=float:left>
I have two divs one inside another. I have given some border to both
i have two divs one floated to the left and the other to the

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.