Partial Border in CSS

后端 未结 2 1222
一生所求
一生所求 2020-12-11 08:59

I have two divs with borders as the picture below shows.

\"enter

How do I remo

相关标签:
2条回答
  • 2020-12-11 09:15

    check this

    http://jsfiddle.net/whsC4/17/

    0 讨论(0)
  • 2020-12-11 09:28

    You could do something like this: http://jsfiddle.net/sj2AD/1/

    #sideBar {
       float: left;
       width: 75px;
       height: 50px;
       border-top: 1px solid black;
       border-left: 1px solid black;
       border-bottom: 1px solid black;
       background: red;
       position: relative;
       z-index: 2;
    }
    
    #balanceSheetSummary {
       float: left;
       width: 150px;
       height: 150px;
       border: 1px solid black;
       background: red;
       position: relative;
       z-index: 1;
       margin-left: -1px;
    }
    
    body { 
       padding: 10px; 
    }
    h2 { 
      margin: 5px; 
    }
    

    What I did was to add a negative margin to the right one so that the boxes overlap.

    This does break, for example if the left div is higher than the right one.

    0 讨论(0)
提交回复
热议问题