.formImg { position: relative; width: 80px; height: 80px; .mask { position: absolute; display: flex; align-items: center; justify-content: space-around; width: 100%; height: 100%; background-color: rgba(0, 0, 0, .6); z-index: 1; cursor: pointer; .icon { font-size: 24px; color: #fff; } } img { width: 80px; height: 80px; cursor: pointer; background-color: #ccc; } }