typography.mdx 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. ---
  2. title: Typography
  3. summary: Typography plays an important role in creating an attractive and clear interface design. Good typography will make the content easy to follow and improve the usability of your website.
  4. bootstrapLink: content/typography/
  5. description: Role of typography in interface design.
  6. ---
  7. ## Headings
  8. Use HTML headings to organize content on your website and make the structure clear and user-friendly. The `h1` to `h6` tags are used to define HTML headings.
  9. The `h1` tag is the highest level and the `h6` tag is the lowest level.
  10. ```html
  11. <h1>H1 Heading</h1>
  12. <h2>H2 Heading</h2>
  13. <h3>H3 Heading</h3>
  14. <h4>H4 Heading</h4>
  15. <h5>H5 Heading</h5>
  16. <h6>H6 Heading</h6>
  17. ```
  18. There is example of headings with different levels:
  19. ```html example vertical columns={1}
  20. <h1>H1 Heading</h1>
  21. <h2>H2 Heading</h2>
  22. <h3>H3 Heading</h3>
  23. <h4>H4 Heading</h4>
  24. <h5>H5 Heading</h5>
  25. <h6>H6 Heading</h6>
  26. ```
  27. ## Paragraphs
  28. Organize longer pieces of text into paragraphs using the `p` tag. It is the most common element for text content.
  29. ```html
  30. <p>At vero eos et accusam et justo duo dolores et ea rebum.</p>
  31. ```
  32. If you use second paragraph, it will be separated from the first one by a blank line.
  33. ```html example vertical centered columns={2}
  34. <div>
  35. <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>
  36. <p>At vero eos et accusam et justo duo dolores et ea rebum.</p>
  37. </div>
  38. ```
  39. ## Semantic text elements
  40. Use a variety of semantic text elements, depending of how you want to display particular fragments of content.
  41. ```html
  42. <abbr title="Internationalization">I18N</abbr>
  43. <strong>Bold</strong>
  44. <cite>Citation</cite>
  45. <code>Hello World!</code>
  46. <del>Deleted</del>
  47. <em>Emphasis</em>
  48. <i>Italic</i>
  49. <ins>Inserted</ins>
  50. <kbd>Ctrl + S</kbd>
  51. <mark>Highlighted</mark>
  52. <s>Strikethrough</s>
  53. <samp>Sample</samp>
  54. Text <sub>Subscripted</sub>
  55. Text <sup>Superscripted</sup>
  56. <time>20:00</time>
  57. <u>Underline</u>
  58. <var>x</var> = <var>y</var> + 2
  59. ```
  60. Here is an example of semantic text elements:
  61. ```html example vertical separated columns={1}
  62. <div>
  63. <abbr title="Internationalization">I1f8N</abbr>
  64. </div>
  65. <div><strong>Bold</strong></div>
  66. <div>
  67. <cite>Citation</cite>
  68. </div>
  69. <div>
  70. <code>Hello World!</code>
  71. </div>
  72. <div>
  73. <del>Deleted</del>
  74. </div>
  75. <div>
  76. <em>Emphasis</em>
  77. </div>
  78. <div>
  79. <i>Italic</i>
  80. </div>
  81. <div>
  82. <ins>Inserted</ins>
  83. </div>
  84. <div>
  85. <kbd>Ctrl + S</kbd>
  86. </div>
  87. <div>
  88. <mark>Highlighted</mark>
  89. </div>
  90. <div>
  91. <s>Strikethrough</s>
  92. </div>
  93. <div>
  94. <samp>Sample</samp>
  95. </div>
  96. <div>Text <sub>Subscripted</sub>
  97. </div>
  98. <div>Text <sup>Superscripted</sup>
  99. </div>
  100. <div>
  101. <time>20:00</time>
  102. </div>
  103. <div>
  104. <u>Underline</u>
  105. </div>
  106. <div>
  107. <var>x</var> = <var>y</var> + 2
  108. </div>
  109. ```
  110. ## Horizontal rules
  111. Use the `hr` tag to represent a thematic break between paragraphs within one section.
  112. ```html example vertical centered columns={2}
  113. <div>
  114. <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A atque ex excepturi fuga magnam nam reiciendis velit. Amet eius eos eveniet fuga in ipsa, ipsum voluptatum. Dolorem expedita quibusdam veniam?</p>
  115. <hr />
  116. <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A atque ex excepturi fuga magnam nam reiciendis velit. Amet eius eos eveniet fuga in ipsa, ipsum voluptatum. Dolorem expedita quibusdam veniam?</p>
  117. </div>
  118. ```
  119. ```html
  120. <hr />
  121. ```
  122. ## Horizontal rules with label
  123. You can also add a label to a horizontal rule and align it as you see fit.
  124. ```html example vertical centered columns={2}
  125. <p>
  126. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
  127. </p>
  128. <div class="hr-text">
  129. <span>Rule text</span>
  130. </div>
  131. <p>
  132. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
  133. </p>
  134. <div class="hr-text hr-text-center">
  135. <span>Rule text</span>
  136. </div>
  137. <p>
  138. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.
  139. </p>
  140. <div class="hr-text hr-text-end">
  141. <span>Rule text</span>
  142. </div>
  143. <p>
  144. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
  145. </p>
  146. ```
  147. ## Optimized for different alphabets
  148. Tabler has been optimized to correctly display content in any language. It supports most Asian, African and Middle Eastern languages.
  149. ```html example vertical centered columns={2}
  150. <p>汉字</p>
  151. <p>日本語の表記体系</p>
  152. <p>Кириллица</p>
  153. <p>Eλληνική</p>
  154. <p>ქართული დამწერლობა</p>
  155. <p>Հայերենի այբուբեն</p>
  156. <p>الحروف العربية</p>
  157. <p>אלפבית עברי</p>
  158. <p>อักษรไทย</p>
  159. ```
  160. ## Text transform
  161. Transform the content of components with text capitalization classes.
  162. ```html example vertical centered separated columns={1}
  163. <div class="text-lowercase">Lowercased text.</div>
  164. <div class="text-uppercase">Uppercased text.</div>
  165. <div class="text-capitalize">Capitalized text.</div>
  166. ```
  167. ```html
  168. <p class="text-lowercase">Lowercased text.</p>
  169. <p class="text-uppercase">Uppercased text.</p>
  170. <p class="text-capitalize">Capitalized text.</p>
  171. ```
  172. ## Letter spacing
  173. Control the tracking (letter spacing) of an element and make it tight, wide or normal.
  174. ```html example vertical centered separated columns={1}
  175. <div class="tracking-tight">Lorem ipsum dolor sit amet. Tight letter spacing.</div>
  176. <div class="tracking-normal">Lorem ipsum dolor sit amet. Normal letter spacing.</div>
  177. <div class="tracking-wide">Lorem ipsum dolor sit amet. Wide letter spacing.</div>
  178. ```
  179. ```html
  180. <p class="tracking-tight">Lorem ipsum dolor sit amet. Tight letter spacing.</p>
  181. <p class="tracking-normal">Lorem ipsum dolor sit amet. Normal letter spacing.</p>
  182. <p class="tracking-wide">Lorem ipsum dolor sit amet. Wide letter spacing.</p>
  183. ```
  184. ## Line height
  185. Control the leading (line height) of an element.
  186. ```html example vertical centered separated columns={1} height="20rem"
  187. <p class="lh-1">
  188. This is the long text with line height 1. Lorem ipsum dolor sit amet. Dolor sit amet.
  189. </p>
  190. <p class="lh-sm">
  191. This is the long text with small line height. Lorem ipsum dolor sit amet. Dolor sit amet.
  192. </p>
  193. <p class="lh-base">
  194. This is the long text with base line height. Lorem ipsum dolor sit amet. Dolor sit amet.
  195. </p>
  196. <p class="lh-lg">
  197. This is the long text with large line height. Lorem ipsum dolor sit amet. Dolor sit amet.
  198. </p>
  199. ```
  200. To control the line height of an element, use the following classes:
  201. ```html
  202. <p class="lh-1">...</p>
  203. <p class="lh-sm">...</p>
  204. <p class="lh-base">...</p>
  205. <p class="lh-lg">...</p>
  206. ```
  207. ## Antialiasing
  208. Control the font smoothing of an element.
  209. Use the `.antialiased` utility to render text using subpixel antialiasing or use the `.subpixel-antialiased` utility to remove antialiasing.
  210. ```html example vertical centered separated columns={1}
  211. <div class="antialiased">Text with antialiasing</div>
  212. <div class="subpixel-antialiased">Text without antialiasing</div>
  213. ```
  214. ## Keyboard input
  215. Use the `<kbd>` to indicate input that is typically entered via keyboard.
  216. ```html example vertical centered
  217. <div>
  218. To edit settings, press <kbd>ctrl</kbd> + <kbd>,</kbd> or <kbd>ctrl</kbd> + <kbd>C</kbd>.
  219. </div>
  220. ```
  221. ```html
  222. To edit settings, press <kbd>ctrl</kbd> + <kbd>,</kbd> or <kbd>ctrl</kbd> + <kbd>C</kbd>.
  223. ```
  224. ## Markdown elements
  225. If you can't use the CSS classes you want or if you just want to use HTML tags, use the `.markdown` class in a container. It will apply the default styles for markdown elements.
  226. ```html example centered background="white" columns={2} height="30rem"
  227. <div class="markdown">
  228. <h1>Hello World</h1>
  229. <p>Lorem ipsum<sup>[1]</sup> dolor sit amet, consectetur adipiscing elit. Nulla accumsan, metus ultrices eleifend gravida, nulla nunc varius lectus, nec rutrum justo nibh eu lectus. Ut vulputate semper dui. Fusce erat odio, sollicitudin vel erat vel, interdum mattis neque. Sub<sub>script</sub> works as well!</p>
  230. <h2>Second level</h2>
  231. <p>Curabitur accumsan turpis pharetra <strong>augue tincidunt</strong> blandit. Quisque condimentum maximus mi, sit amet commodo arcu rutrum id. Proin pretium urna vel cursus venenatis. Suspendisse potenti. Etiam mattis sem rhoncus lacus dapibus facilisis. Donec at dignissim dui. Ut et neque nisl.</p>
  232. <ul>
  233. <li>In fermentum leo eu lectus mollis, quis dictum mi aliquet.</li>
  234. <li>Morbi eu nulla lobortis, lobortis est in, fringilla felis.</li>
  235. <li>Aliquam nec felis in sapien venenatis viverra fermentum nec lectus.</li>
  236. <li>Ut non enim metus.</li>
  237. </ul>
  238. </div>
  239. ```