CSS Border rendering

前端 未结 2 612
小鲜肉
小鲜肉 2021-01-14 21:03

I like to know if is possible to specify the border drawing style (not border-style) with CSS (I need that works at least on webkit).

2条回答
  •  再見小時候
    2021-01-14 21:28

    You could use CSS pseudo-content to achieve a fake border, like this:

    .red-mark:before {
      content: '';
      display:block;
      width: 15px;
      position: absolute;
      top: -15px;
      left: -15px;
      bottom: -15px;
      background: red;
    }
    

    See: http://jsfiddle.net/MnPka/1/

    The minus positions are because 0 starts within the border. You may be able to change this behaviour by setting box-sizing though support for that isn't that great yet - http://caniuse.com/#search=box-sizing

提交回复
热议问题