index.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>3 shapes - CSS Gradient Rounded Borders</title>
  6. <style>
  7. body {
  8. display: flex;
  9. justify-content: space-around;
  10. align-content: center;
  11. align-items: center;
  12. flex-wrap: wrap;
  13. min-height: 100vh;
  14. margin: 0;
  15. background-image: linear-gradient(#111, #050505);
  16. --img-url: url(https://images.unsplash.com/photo-1506794778202-cad84cf45f1d?w=350&h=350&fit=crop&crop=faces);
  17. }
  18. .headshot {
  19. flex-shrink: 0;
  20. margin: 20px;
  21. height: calc(150px + 6vw);
  22. width: calc(150px + 6vw);
  23. border: calc(8px + 0.2vw) solid transparent;
  24. background-origin: border-box;
  25. background-clip: content-box, border-box;
  26. background-size: cover;
  27. box-sizing: border-box;
  28. box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.5);
  29. }
  30. .headshot-1 {
  31. border-radius: 30%;
  32. background-image: var(--img-url), linear-gradient(#f9f047, #0fd850);
  33. }
  34. .headshot-2 {
  35. border-radius: 50%;
  36. background-image: var(--img-url), linear-gradient(to bottom right, #ff3cac, #562b7c, #2b86c5);
  37. }
  38. .headshot-3 {
  39. border-radius: 50% 10%;
  40. background-image: var(--img-url), linear-gradient(to bottom left, #f83600, #f9d423);
  41. }
  42. </style>
  43. </head>
  44. <body>
  45. <div class="headshot headshot-1"></div>
  46. <div class="headshot headshot-2"></div>
  47. <div class="headshot headshot-3"></div>
  48. <script>
  49. // https://codepen.io/GeorgePark/pen/EEGJEj
  50. </script>
  51. </body>
  52. </html>