Avoid Border Overlap CSS

前端 未结 1 935
轻奢々
轻奢々 2020-12-17 20:26

This is a simple question, I even think someone asked this before, but It never got a real answer.

What I want is to avoid border overlapping, It\'s that simple. Her

相关标签:
1条回答
  • 2020-12-17 21:30

    You can overlay a pseudo element over your div:

    div {
        background-color: gold;
        border-top: 4px solid #172e4e;
        height: 100px;
        position: relative;
        width: 100px;
    }
    
    div::after {
        content: "";
        position: absolute;
        bottom: 0; top: 0px; left: 0; right: 0;
        border-right:4px solid orange;
        border-left:4px solid orange;
    }
    

    Example: http://jsfiddle.net/vpHW5/10/

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