05-22-box-shadow-profile-photo.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Box shadow on profile photo</title>
  6. <style>
  7. body {
  8. padding: 2em;
  9. margin: 0;
  10. font-family: "Helvetica Neue", Arial, sans-serif;
  11. background-color: #ddd;
  12. }
  13. .profile-photo {
  14. width: 160px;
  15. min-height: 200px;
  16. display: inline-block;
  17. margin-right: 2em;
  18. padding: .5em;
  19. -webkit-border-radius: .5em;
  20. border-radius: .5em;
  21. -webkit-box-shadow: .25em .25em .5em rgba(0, 0, 0, 0.3);
  22. box-shadow: .25em .25em .5em rgba(0, 0, 0, 0.3);
  23. background-color: #fff;
  24. }
  25. .profile-larger-shadow {
  26. box-shadow: 1em 1em .5em .5em rgba(0, 0, 0, 0.3);
  27. }
  28. .profile-smaller-shadow {
  29. box-shadow: 1em 1em .5em -.5em rgba(0, 0, 0, 0.3);
  30. }
  31. .profile-photo img {
  32. display: block;
  33. max-width: 100%;
  34. height: auto;
  35. }
  36. .username {
  37. font-size: 20px;
  38. color: #666;
  39. margin: .35em 0 0;
  40. }
  41. </style>
  42. </head>
  43. <body>
  44. <div class="profile-photo">
  45. <img src="img/profile.jpg" alt="Charles the Cat">
  46. <h1 class="username">@CharlesTheCat</h1>
  47. </div>
  48. <div class="profile-photo profile-larger-shadow">
  49. <img src="img/profile.jpg" alt="Charles the Cat">
  50. <h1 class="username">@CharlesTheCat</h1>
  51. </div>
  52. <div class="profile-photo profile-smaller-shadow">
  53. <img src="img/profile.jpg" alt="Charles the Cat">
  54. <h1 class="username">@CharlesTheCat</h1>
  55. </div>
  56. </body>
  57. </html>