CSS Double Border with outer border thicker than inner border

后端 未结 5 1902
一个人的身影
一个人的身影 2020-12-01 10:31

In my current work I\'m required to produce a double border on a container. The border-style: double; achieve this, however my client want the outer border to be thicker &am

5条回答
  •  悲哀的现实
    2020-12-01 11:12

    No, it's not possible. The CSS border width specifies the total thickness of the border, regardless of the border style. I don't see a better way than wrapping it in another DIV.

    Edit: You could hack it in using outline, but there is a subtle difference between outline and border.

    border: double 4px black;
    outline: solid 3px black;
    

    (this will produce a 1px inner and 4px outer "border", if you can call it that)

提交回复
热议问题