outline on only one border

前端 未结 7 866
独厮守ぢ
独厮守ぢ 2020-12-04 14:23

How to apply an inset border into an HTML element, but just only on one side of it. Until now, I\'ve been using an image to do that (GIF/PNG) that I would

7条回答
  •  猫巷女王i
    2020-12-04 15:01

    The great thing about HTML/CSS is that there's usually more than one way to achieve the same effect. Here's another solution that does what you want:

    
    
    nav {
        background:#666;
        margin:1em;
        padding:.5em 0;
    }
    nav ul {
        border-top:1px dashed #fff;
        list-style:none;
        padding:.5em;
    }
    nav ul li {
        display:inline-block;
    }
    nav ul li a {
        color:#fff;
    }
    

    http://jsfiddle.net/10basetom/uCX3G/1/

提交回复
热议问题