04-06-vertical-align-values.html 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Vertical align values</title>
  6. <style>
  7. body {
  8. font-family: Georgia, Times, 'Times New Roman', serif;
  9. line-height: 1.5;
  10. margin: 0;
  11. padding: 3em 1em;
  12. }
  13. article {
  14. max-width: 38em;
  15. margin: 0 auto;
  16. }
  17. h1, h2, h3, h4, h5, h6 {
  18. font-family: Avenir Next, Avenir, SegoeUI, arial, sans-serif;
  19. line-height: 1.25em;
  20. margin-top: 24px; /* fallback for IE<9 */
  21. margin-top: 1.5rem; /* 24px */
  22. margin-bottom: .25em;
  23. font-weight: 500;
  24. }
  25. h1 {
  26. font-size: 2.315em; /* 37px */
  27. font-weight: 800;
  28. border-bottom: 1px solid #C8BC9D;
  29. text-align: center;
  30. margin-bottom: .5em;
  31. }
  32. h2 {
  33. font-weight: 600;
  34. font-size: 1.75em; /* 28px */
  35. }
  36. h3 {
  37. font-size: 1.333em; /* 20px */
  38. }
  39. p {
  40. margin: 0;
  41. color: #777;
  42. }
  43. abbr {
  44. text-transform: lowercase;
  45. font-variant: small-caps;
  46. letter-spacing: 0.05em;
  47. font-size: 1.0625em;
  48. }
  49. p + p {
  50. margin-top: 0;
  51. text-indent: 1.25em;
  52. }
  53. .source {
  54. margin-top: 1.5em;
  55. text-align: right;
  56. font-style: italic;
  57. }
  58. span {
  59. color: #000;
  60. }
  61. .sub {
  62. vertical-align: sub;
  63. }
  64. .super {
  65. vertical-align: super;
  66. }
  67. .text-top,
  68. .text-bottom {
  69. font-size: .75em;
  70. }
  71. .text-top {
  72. vertical-align: text-top;
  73. }
  74. .text-bottom {
  75. vertical-align: text-bottom;
  76. }
  77. .top {
  78. vertical-align: top;
  79. }
  80. .bottom {
  81. vertical-align: bottom;
  82. }
  83. .middle {
  84. vertical-align: middle;
  85. }
  86. .top-em {
  87. vertical-align: 2em;
  88. }
  89. .bottom-perc {
  90. vertical-align: -100%;
  91. }
  92. </style>
  93. </head>
  94. <body>
  95. <article>
  96. <p>The Moon’s gravitational influence produces the ocean tides, body tides, and the slight lengthening of the day. The Moon’s current orbital distance is about thirty times the diameter of Earth, causing it to have an apparent size in the sky almost the same as that of the Sun, with the result that the Moon covers the Sun nearly precisely in total solar eclipse. <span class="super">super</span> <span class="sub">sub</span> <span class="text-top">text-top</span> <span class="text-bottom">text-bottom</span> <span class="top">top</span> <span class="bottom">bottom</span> <span class="middle">middle</span> <span class="top-em">2em</span> <span class="bottom-perc">-100%</span>This matching of apparent visual size will not continue in the far future. The Moon’s linear distance from Earth is currently increasing at a rate of 3.82 ± 0.07 centimetres per year, but this rate is not constant.</p>
  97. </article>
  98. </body>
  99. </html>