How can I set a css border on one side only?

前端 未结 6 1813
既然无缘
既然无缘 2021-01-31 00:59

For a given div I would like to only display a border on the left, right, top, or bottom side.

Currently I have the following, which puts a border on all s

6条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-31 01:57

    If you want to set 4 sides separately use:

    border-width: 1px 2em 5px 0; /* top right bottom left */
    border-style: solid dotted inset double;
    border-color: #f00 #0f0 #00f #ff0;
    

提交回复
热议问题