Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>in CSS3, everything is possible.</p> <p><strong>HTML:</strong></p> <pre class="lang-html prettyprint-override"><code>&lt;div class="hexagon hexagon1"&gt;&lt;div class="hexagon-in1"&gt;&lt;div class="hexagon-in2"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="hexagon hexagon2"&gt;&lt;div class="hexagon-in1"&gt;&lt;div class="hexagon-in2"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt; &lt;div class="hexagon dodecagon"&gt;&lt;div class="hexagon-in1"&gt;&lt;div class="hexagon-in2"&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt; </code></pre> <p><strong>CSS:</strong></p> <pre class="lang-css prettyprint-override"><code>BODY { background: url(http://placekitten.com/600/600) } .hexagon { overflow: hidden; visibility: hidden; -webkit-transform: rotate(120deg); -moz-transform: rotate(120deg); -o-transform: rotate(120deg); transform: rotate(120deg); cursor: pointer; } .hexagon-in1 { overflow: hidden; width: 100%; height: 100%; -webkit-transform: rotate(-60deg); -moz-transform: rotate(-60deg); -o-transform: rotate(-60deg); transform: rotate(-60deg); } .hexagon-in2 { width: 100%; height: 100%; background-repeat: no-repeat; background-position: 50%; background-image: url(http://placekitten.com/240/240); visibility: visible; -webkit-transform: rotate(-60deg); -moz-transform: rotate(-60deg); -o-transform: rotate(-60deg); transform: rotate(-60deg); } .hexagon-in2:hover { background-image: url(http://placekitten.com/241/241) } .hexagon1 { width: 400px; height: 200px; margin: 0 0 0 -80px; } .hexagon2 { width: 200px; height: 400px; margin: -80px 0 0 20px; } .dodecagon { width: 200px; height: 200px; margin: -80px 0 0 20px; } </code></pre> <p><strong>Demo:</strong> <a href="http://jsfiddle.net/kizu/bhGn4/" rel="nofollow">http://jsfiddle.net/kizu/bhGn4/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload