body { margin: 0; font-family: Sans; } .card { display: flex; width: 150px; height: 220px; align-items: center; justify-content: center; background-color: #ddd; margin: 5px; float: left; box-shadow: #000000 1px 1px 7px -1px; font-size: 17pt; color: #4c4c4c; opacity: 1; transition: background-color 200ms ease-in-out, opacity 200ms ease-in-out, top 200ms ease-in-out, left 200ms ease-in-out, transform 100ms ease-in-out; } .selected { background-color: #76bce2; } .card.selected:hover { background-color: #76bce2; } .card:hover { background-color: #e3cfbb; }