-1

I have tiles which expand on hover event but they are partly covered by adjacent tiles, how can i fix this?

css code snippet:

.tile {
  position: absolute;
  width: 86px;
  background-color: #000000;
  height: 86px;
  color: #fff;
  transition: 1s linear all;
  overflow: hidden;
}
.tile:hover {
  background-color: #333333;
  height: 172px;
  width: 172px;
}

here is a link to my fiddle: https://jsfiddle.net/zjcfope1/

D4v3
  • 31
  • 11

2 Answers2

2

Add z-index to the tile class. Check out this updated fiddle

.tile {
 position: absolute;
 width: 86px;
 background-color: #000000;
 height: 86px;
 color: #fff;
 transition: 1s linear all;
 overflow: hidden;
 z-index: -9999;
}

.tile:hover {
 background-color: #333333;
 height: 172px;
 width: 172px;
 z-index: 9999;
}
cheralathan
  • 572
  • 5
  • 14
0

is this is you want just try this.

.tile:hover {
background-color: #333333;
 height: 172px;`
  width: 172px;
z-index:1000;

}