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?

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
A lot of people have suggested getting the smaller
divto 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 thedivborders overlap:http://jsfiddle.net/RWz4A/
In order to avoid this, you can explicitly remove the left border, and have a non-transparent background.
HTML
CSS
jsFiddle Demo
Edit:
As thirdender mentioned, you can also use
margin-leftinstead of a combination ofpositionandleft. This may be a better option for you depending on your previous styling and how the elements are arranged (probably better in most cases ifmargin-leftis not already set).Zach Shipley also made a good point about browser support for
display: inline-blockand added the following CSS: