1px实现

点我

使用方法

HTML

<div class="box border border-top"></div>
<div class="box border border-right"></div>
<div class="box border border-bottom"></div>
<div class="box border border-left"></div>
<div class="box box-1 border border-all"></div>
<div class="box box-2 border border-all"></div>
    

CSS(Stylus)

@require "1px"

size(w, h)
    width: w
    height: h

.box
    size: 80px 40px
    margin: 0 auto
    margin-top 10px

.box-1
    set-border-radius(80px)

.box-2
    set-border-radius(0)

// set default color
.border
    set-border-color(#55555d)

.border-left
    set-border-color(red)