05-26-linear-gradient-profile-box.html 1.4 KB

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