.layer{ position: relative; } .description{ position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; opacity: 0; background-color:rgba(0, 0, 0, 0.6); text-align: center; color:white; //ellipsis text-overflow: ellipsis; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 9; -webkit-box-orient: vertical; overflow: hidden; &:hover{ opacity: 1; } }