11-25-isolation.html 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <title>Isolation demo</title>
  5. <style>
  6. html,body {
  7. height: 100%;
  8. }
  9. body {
  10. background-image: repeating-linear-gradient(45deg, #fff, #fff 20px, #eee 0, #eee 40px);
  11. background-size: cover;
  12. }
  13. .group {
  14. position: relative;
  15. margin: 2em;
  16. }
  17. .group-b {
  18. left: 200px;
  19. /*opacity: 0.999;*/
  20. isolation: isolate;
  21. }
  22. .item {
  23. width: 100px;
  24. height: 100px;
  25. position: absolute;
  26. background-color: #ccc;
  27. mix-blend-mode: multiply;
  28. -webkit-clip-path: circle();
  29. clip-path: circle();
  30. }
  31. .one {
  32. top: 57px;
  33. left: 46px;
  34. background-color: #ff55dc;
  35. }
  36. .two {
  37. background-color: #69cfff;
  38. }
  39. .three {
  40. left: 75px;
  41. top: -12px;
  42. background-color: #afff8e;
  43. }
  44. </style>
  45. </head>
  46. <body>
  47. <div class="group group-a">
  48. <div class="item one"></div>
  49. <div class="item two"></div>
  50. <div class="item three"></div>
  51. </div>
  52. <div class="group group-b">
  53. <div class="item one"></div>
  54. <div class="item two"></div>
  55. <div class="item three"></div>
  56. </div>
  57. </body>
  58. </html>