fun.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <html>
  2. <head>
  3. <style>
  4. @font-face {
  5. font-family: "Raleway";
  6. font-style: normal;
  7. font-weight: 400;
  8. src: local("Raleway"), url("http://fonts.gstatic.com/s/raleway/v9/0dTEPzkLWceF7z0koJaX1A.woff2") format("woff2");
  9. }
  10. body {
  11. padding-top: 200px;
  12. margin: 0;
  13. width: 100%;
  14. text-align: center;
  15. font-family: Raleway;
  16. font-size: 32px;
  17. background-color: #0E83CD;
  18. }
  19. a {
  20. display: inline-block;
  21. position: relative;
  22. text-decoration: none;
  23. color: #0972B4;
  24. border-width: 0;
  25. border-style: solid;
  26. border-top-width: 3px;
  27. border-color: #0972B4;
  28. padding: 10px 0;
  29. margin: 30px;
  30. }
  31. a:hover {
  32. color: #0972B4;
  33. }
  34. a:hover::before {
  35. max-width: 100%;
  36. }
  37. a:active {
  38. color: #0972B4;
  39. }
  40. a::before {
  41. position: absolute;
  42. top: 0;
  43. left: 0;
  44. content: attr(data-hover);
  45. color: white;
  46. max-width: 0px;
  47. overflow: hidden;
  48. padding: 10px 0;
  49. border-width: 0;
  50. border-style: solid;
  51. border-bottom-width: 3px;
  52. border-color: white;
  53. transition: max-width 0.5s ease 0s;
  54. }
  55. </style>
  56. </head>
  57. <body>
  58. <a href="#" data-hover="Katja">Katja</a>
  59. <a href="#" data-hover="Johannes">Johannes</a>
  60. <a href="#" data-hover="Dieter">Dieter</a>
  61. <a href="#" data-hover="Margarethe">Margarethe</a>
  62. </body>
  63. </html>