Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It can be reproduced really well, with minimal markup in... well, almost any browser, really. I did two versions, the <strong>HTML</strong> for both is the same.</p> <pre><code>&lt;div class='box box1'&gt; &lt;div class='box1-content'&gt;Box 1 content goes here.&lt;/div&gt; &lt;/div&gt; &lt;div class='box box2'&gt;Box 2 content goes here.&lt;/div&gt; </code></pre> <p>The <strong>first version</strong> uses <strong>CSS 3D transforms</strong> and should work in Safari, Chrome, Firefox and IE10. Opera and IE9 (and older) don't support 3D transforms, so it won't work for those.</p> <h1><a href="http://dabblet.com/gist/4570533" rel="nofollow"><em>demo</em></a></h1> <p>Relevant <strong>CSS</strong>:</p> <pre><code>html { background: linear-gradient(#165284, #3672a4) no-repeat; } .box { position: relative; margin: 0 auto; width: 90%; } .box1-content, .box2 { box-sizing: border-box; padding: 1%; min-height: 16em; } .box1 { z-index: 2; margin-bottom: 1.6em; box-shadow: 0 1.4em 1em -1em; } .box1:before, .box1:after { position: absolute; z-index: -1; top: .5em; right: .6em; bottom: .5em; left: .6em; border-radius: .35em; box-shadow: 0 0 2em; content: ''; } .box1:before { transform: skewX(5deg); } .box1:after { transform: skewX(-5deg); } .box1-content { border-radius: 0 0 .5em .5em; background: linear-gradient(-45deg, #e14f00, #f88d00); } .box2 { z-index: 1; background: gainsboro; perspective: 32em; } .box2:before { display: block; position: absolute; bottom: 100%; left: 0; width: 100%; height: 5em; transform: rotateX(45deg); transform-origin: 50% 100% 0; background: linear-gradient(dimgrey, silver); content: ''; } </code></pre> <hr> <p>The <strong>second version</strong> is the <strong>better compatibility</strong> one and should work fully (shadows + emulate 3D effect) in Chrome, Safari, Firefox, IE9+ and Opera. The 3D effect should also be emulated in IE8, even if the shadows won't be there.</p> <h1><a href="http://dabblet.com/gist/4570702" rel="nofollow"><em>demo</em></a></h1> <p>Relevant <strong>CSS</strong>:</p> <pre><code>html { filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#165284', endColorstr='#3672a4', GradientType=0); /* fallback for IE9/8 */ background: linear-gradient(#165284, #3672a4) no-repeat; } .box { position: relative; margin: 0 auto; width: 90%; } .box1-content, .box2 { box-sizing: border-box; padding: 1%; min-height: 16em; } .box1 { z-index: 2; margin-bottom: 1.6em; box-shadow: 0 1.4em 1em -1em; /* not supported in IE8 */ } .box1:before, .box1:after { position: absolute; z-index: -1; top: .5em; right: .6em; bottom: .5em; left: .6em; border-radius: .35em; /* not supported in IE8 */ box-shadow: 0 0 2em; /* not supported in IE8 */ content: ''; } .box1:before { transform: skewX(5deg); } /* not supported in IE8 */ .box1:after { transform: skewX(-5deg); } /* not supported in IE8 */ .box1-content { border-radius: 0 0 .5em .5em; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#e14f00', endColorstr='#f88d00', GradientType=1); /* fallback for IE9/8 */ background: linear-gradient(-45deg, #e14f00, #f88d00); } .box2 { z-index: 1; background: gainsboro; } .box2:before { position: absolute; bottom: 100%; right: 0; left: 0; border: solid 4em transparent; border-bottom: solid 5em silver; content: ''; } </code></pre> <p>You could go overboard and try to emulate shadows for IE8/ 3D effect and shadows for IE7 using additional elements instead of pseudo-elements and applying matrix transform/ shadow filters on those, but I think it's not worth it.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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