Bucheron
Bucheron

Reputation: 55

How can I do this double border with offset in CSS?

I need to be able to create this double border with CSS only. enter image description here

A simple double border is sure easy, but i need an offset for the second.

Does anyone know how to do it ?

Thanks

Upvotes: 0

Views: 92

Answers (1)

user7148391
user7148391

Reputation:

Using box-shadow you can do something like this.

One shadow will be a solid color, we then use a second to cover the inside.

div {
  width:100px;
  height:100px;
  border: 1px solid;
  box-shadow: 
  8px 8px 0px 1px white
  , 8px 8px 0px 2px black;
}
<div></div>

Upvotes: 1

Related Questions