<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
width: 100vw;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(25vw, 1fr));
grid-gap: 10px;
padding: 10px;
}
div {
min-height: 150px;
&:nth-child(1) {
width: calc(100% - 8px);
height: calc(150px - 8px);
margin: 4px auto;
border: 5px solid orange;
box-shadow: 0px 0px 0 4px red;
}
&:nth-child(2) {
width: calc(100% - 8px);
height: calc(150px - 8px);
margin: 4px auto;
border: 5px solid orange;
outline: 4px solid red;
}
&:nth-child(3) {
border: 4px solid red;
padding: 5px;
background: linear-gradient(to right, #fff, #fff), orange;
background-clip: content-box, padding-box;
}
&:nth-child(4) {
border: 4px solid transparent;
padding: 5px;
background: linear-gradient(to right, #fff, #fff),linear-gradient(to right, orange, orange), red;
background-clip: content-box, padding-box, border-box;
}
&:nth-child(5){
position: relative;
padding: 9px;
background: linear-gradient(to right, #fff, #fff);
background-clip: content-box;
&::before,
&::after {
content: '';
position: absolute;
}
&::before {
background: orange;
z-index: -1;
top: 4px;
right: 4px;
bottom: 4px;
left: 4px;
}
&::after {
content: '';
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: -2;
background: red;
}
}
}
View Compiled
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.