Pure CSS3 box-shadow page curl effect


SUBMITTED BY: Guest

DATE: May 2, 2013, 6:11 p.m.

FORMAT: Text only

SIZE: 1.9 kB

HITS: 1470

  1. - HTML---------------------------------------------------------------------------
  2. <ul class="box">
  3. <li></li>
  4. <li></li>
  5. <li></li>
  6. <li></li>
  7. <li></li>
  8. <li></li>
  9. </ul>
  10. - CSS ---------------------------------------------------------------------------
  11. ul.box {
  12. position: relative;
  13. z-index: 1; /* prevent shadows falling behind containers with backgrounds */
  14. overflow: hidden;
  15. list-style: none;
  16. margin: 0;
  17. padding: 0; }
  18. ul.box li {
  19. position: relative;
  20. float: left;
  21. width: 250px;
  22. height: 150px;
  23. padding: 0;
  24. border: 1px solid #efefef;
  25. margin: 0 30px 30px 0;
  26. background: #fff;
  27. -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  28. -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset;
  29. box-shadow: 0 1px 4px rgba(0, 0, 0, 0.27), 0 0 40px rgba(0, 0, 0, 0.06) inset; }
  30. ul.box li:before,
  31. ul.box li:after {
  32. content: '';
  33. z-index: -1;
  34. position: absolute;
  35. left: 10px;
  36. bottom: 10px;
  37. width: 70%;
  38. max-width: 300px; /* avoid rotation causing ugly appearance at large container widths */
  39. max-height: 100px;
  40. height: 55%;
  41. -webkit-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  42. -moz-box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  43. box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
  44. -webkit-transform: skew(-15deg) rotate(-6deg);
  45. -moz-transform: skew(-15deg) rotate(-6deg);
  46. -ms-transform: skew(-15deg) rotate(-6deg);
  47. -o-transform: skew(-15deg) rotate(-6deg);
  48. transform: skew(-15deg) rotate(-6deg); }
  49. ul.box li:after {
  50. left: auto;
  51. right: 10px;
  52. -webkit-transform: skew(15deg) rotate(6deg);
  53. -moz-transform: skew(15deg) rotate(6deg);
  54. -ms-transform: skew(15deg) rotate(6deg);
  55. -o-transform: skew(15deg) rotate(6deg);
  56. transform: skew(15deg) rotate(6deg); }

comments powered by Disqus