I am trying to create a grid of hexagons. For funky effect, I use css conversion effects. In FireFox, this seems to work correctly, but in Google Chrome, the top div does not seem to give the expected hover effect. Here is the code I'm using:
<html> <head> <style> body{ margin:0; } .board{ width: 550px; height: 300px; margin: 20px auto; -webkit-transform: perspective(700px) rotateX(65deg); -moz-transform: perspective(700px) rotateX(65deg); -ms-transform: perspective(700px) rotateX(65deg); -o-transform: perspective(700px) rotateX(65deg); transform: perspective(700px) rotateX(65deg); padding:10; } .hex-row { clear: left; } .hex-row.even { margin-left: 53px; } .hex:hover{ background: #446; } .hex:hover:before{ border-bottom: 30px solid #446; } .hex:hover:after{ border-top: 30px solid #446; } .hex:before { content: " "; width: 0; height: 0; border-bottom: 30px solid #6C6; border-left: 52px solid transparent; border-right: 52px solid transparent; position: absolute; top: -30px; } .hex { width: 104px; height: 60px; background-color: #6C6; position: relative; float:left; margin-top: 32px; margin-left: 3px; margin-bottom: 3px; } .hex:after { content: " "; width: 0; position: absolute; bottom: -30px; border-top: 30px solid #6C6; border-left: 52px solid transparent; border-right: 52px solid transparent; } .hex.disabled{ background-color: #888; } .hex.disabled:before { border-bottom: 30px solid #888; } .hex.disabled:after { border-top: 30px solid #888; } </style> </head> <body> <div class="board"> <div class="hex-row"> <div class="hex disabled"></div> <div class="hex disabled"></div> <div class="hex"></div> <div class="hex disabled"></div> <div class="hex disabled"></div> </div> <div class="hex-row even"> <div class="hex"></div> <div class="hex"></div> <div class="hex"></div> <div class="hex"></div> </div> <div class="hex-row"> <div class="hex disabled"></div> <div class="hex"></div> <div class="hex"></div> <div class="hex"></div> <div class="hex disabled"></div> </div> <div class="hex-row even"> <div class="hex"></div> <div class="hex"></div> <div class="hex"></div> <div class="hex"></div> </div> <div class="hex-row"> <div class="hex disabled"></div> <div class="hex disabled"></div> <div class="hex"></div> <div class="hex disabled"></div> <div class="hex disabled"></div> </div> </div> </body> </html>
To quickly use this feature, you can use the following link: http://jsfiddle.net/a55eF/2/ and click the "Run" button. You will see the result in the lower right corner.
Does anyone have any suggestions for fixing the freeze? Thanks in advance!
Thoys source share