  background: grey;
  justify-content: center;
}
.grid.LTR, .grid.RTL { width: 450px; }
.grid.verticalLR, .grid.verticalRL { height: 450px; }
.grid > div { position: absolute; }
.grid > :nth-child(1) { background: green; }
.grid > :nth-child(2) { background: blue; }
.grid > :nth-child(3) { background: yellow; }
.grid > :nth-child(4) { background: red; }

.grid > div {
   margin: 2px 4px 6px 8px;
   padding: 3px 2px 4px 5px;
   border-color: silver;
   border-style: solid;
   border-width: 1px 6px 2px 3px;
}