<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% - 20px);
    height: calc(150px - 20px);
    margin: 10px auto;
    outline: 10px dashed red;
    box-shadow: 0 0 0 10px;
  }
  
  &:nth-child(2) {
    border: 10px dashed;
    background:
      linear-gradient(to top, red, 10px, transparent 10px),
      linear-gradient(to right, red, 10px, transparent 10px),
      linear-gradient(to bottom, red, 10px, transparent 10px),
      linear-gradient(to left, red, 10px, transparent 10px);
    background-origin: border-box;
  }
  
  &:nth-child(3) {
    border: 10px dashed;
    background: linear-gradient(to top, #fff, #fff), red;
    background-clip: padding-box, border-box;
  }
  
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.