10-07-transform-origin-rotate-translate-text.html 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Using transform-origin to rotate text</title>
  6. <style>
  7. body {
  8. font-family: Baskerville, Times, Times New Roman, serif;
  9. font-size: 1.25em;
  10. padding: 3em;
  11. }
  12. h1 {
  13. font-weight: 400;
  14. }
  15. .rules {
  16. counter-reset: rulecount 2;
  17. list-style: none;
  18. padding: 0;
  19. margin: 0;
  20. }
  21. .rules li {
  22. line-height: 1.5;
  23. min-height: 1.75em;
  24. counter-increment: rulecount;
  25. max-width: 35em;
  26. border-left: 1.5em solid #777;
  27. padding-left: .5em;
  28. position: relative;
  29. margin-bottom: .5em;
  30. }
  31. .rules li:before {
  32. position: absolute;
  33. top: 0;
  34. left: 0;
  35. padding-right: .25em;
  36. display: block;
  37. color: #fff;
  38. line-height: 1.5em;
  39. padding-left: .25em;
  40. content: '§ ' counter(rulecount);
  41. -webkit-transform: translate(-100%, -100%) rotate(-90deg);
  42. -moz-transform: translate(-100%, -100%) rotate(-90deg);
  43. -ms-transform: translate(-100%, -100%) rotate(-90deg);
  44. -o-transform: translate(-100%, -100%) rotate(-90deg);
  45. transform: translate(-100%, -100%) rotate(-90deg);
  46. -webkit-transform-origin: 100% 100%;
  47. -moz-transform-origin: 100% 100%;
  48. -ms-transform-origin: 100% 100%;
  49. -o-transform-origin: 100% 100%;
  50. transform-origin: 100% 100%;
  51. }
  52. </style>
  53. </head>
  54. <body>
  55. <h1>Fight Club rules</h1>
  56. <ol class="rules" start="3">
  57. <li>If someone says ”stop”, goes limp or taps out, the fight is over.</li>
  58. <li>Only two guys to a fight.</li>
  59. <li>One fight at a time.</li>
  60. <li>No shirts, no shoes.</li>
  61. <li>Fights will go on as long as they have to.</li>
  62. <li>If this is your first night at FIGHT CLUB, you HAVE to fight.</li>
  63. </ol>
  64. </body>
  65. </html>