Fork me on GitHub

li的border无法和上边对齐

如果利用border设置四周的border,如果一边的边框比较长无法对齐

解决办法:

        .test{
            position: relative;
            border: 1px solid #808080;
            height: 100px;
            width: 100px;
        }
        .test:after{
            content: '';
            position: absolute;
            right: -10px;
            top:-1px;
            width: 0;
            height: 0;
            border-width: 102px 10px 0 0;
            border-style: solid;
            border-color:red;
        }
        <div class="test">

        </div>

 

posted @ 2015-12-13 17:27  CangoWu  阅读(377)  评论(0编辑  收藏  举报