CSS-typography.txt 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. Typography
  2. ===============================================================================
  3. Headings
  4. --------
  5. All HTML headings, :code:`<h1>` through :code:`<h6>`, are available. :code:`.h1`
  6. through :code:`.h6` classes are also available, for when you want to match the font
  7. styling of a heading but still want your text to be displayed inline.
  8. .. container:: bs-example
  9. .. list-table::
  10. :widths: 75 25
  11. :class: table
  12. * - :h1:`h1. Bootstrap heading`
  13. - **Semibold 36 px**
  14. * - :h2:`h2. Bootstrap heading`
  15. - **Semibold 30 px**
  16. * - :h3:`h3. Bootstrap heading`
  17. - **Semibold 24 px**
  18. * - :h4:`h4. Bootstrap heading`
  19. - **Semibold 18 px**
  20. * - :h5:`h5. Bootstrap heading`
  21. - **Semibold 14 px**
  22. * - :h6:`h6. Bootstrap heading`
  23. - **Semibold 12 px**
  24. .. code::
  25. :class: highlight
  26. h1. Bootstrap heading
  27. =====================
  28. h2. Bootstrap heading
  29. ---------------------
  30. h3. Bootstrap heading
  31. +++++++++++++++++++++
  32. h4. Bootstrap heading
  33. ~~~~~~~~~~~~~~~~~~~~~
  34. h5. Bootstrap heading
  35. *********************
  36. h6. Bootstrap heading
  37. ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨
  38. Create lighter, secondary text in any heading with a generic :code:`small` tag.
  39. .. container:: bs-example
  40. .. list-table::
  41. :widths: 100
  42. :class: table
  43. * - :h1:`h1. Bootstrap heading <small>Secondary text</small>`
  44. * - :h2:`h2. Bootstrap heading <small>Secondary text</small>`
  45. * - :h3:`h3. Bootstrap heading <small>Secondary text</small>`
  46. * - :h4:`h4. Bootstrap heading <small>Secondary text</small>`
  47. * - :h5:`h5. Bootstrap heading <small>Secondary text</small>`
  48. * - :h6:`h6. Bootstrap heading <small>Secondary text</small>`
  49. .. code::
  50. :class: highlight
  51. h1. Bootstrap heading :small:`Secondary text`
  52. =============================================
  53. h2. Bootstrap heading :small:`Secondary text`
  54. ---------------------------------------------
  55. h3. Bootstrap heading :small:`Secondary text`
  56. +++++++++++++++++++++++++++++++++++++++++++++
  57. h4. Bootstrap heading :small:`Secondary text`
  58. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  59. h5. Bootstrap heading :small:`Secondary text`
  60. *********************************************
  61. h6. Bootstrap heading :small:`Secondary text`
  62. ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨
  63. Body copy
  64. ---------
  65. Bootstrap's global default `font-size` is **14px**, with a line-height of
  66. **1.428**. This is applied to the `<body>` and all paragraphs. In addition,
  67. `<p>` (paragraphs) receive a bottom margin of half their computed line-height
  68. (10px by default).
  69. .. container:: bs-example
  70. Nullam quis risus eget urna mollis ornare vel eu leo. Cum sociis natoque
  71. penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id
  72. dolor id nibh ultricies vehicula.
  73. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur
  74. ridiculus mus. Donec ullamcorper nulla non metus auctor fringilla. Duis
  75. mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia
  76. odio sem nec elit. Donec ullamcorper nulla non metus auctor fringilla.
  77. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id
  78. elit non mi porta gravida at eget metus. Duis mollis, est non commodo
  79. luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.
  80. .. code::
  81. :class: highlight
  82. ...
  83. Lead body copy
  84. ++++++++++++++
  85. Make a paragraph stand out by adding lead.
  86. .. container:: bs-example
  87. .. lead:: Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor
  88. auctor. Duis mollis, est non commodo luctus.
  89. .. code::
  90. :class: highlight
  91. .. lead:: Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor
  92. auctor. Duis mollis, est non commodo luctus.
  93. Built with Less
  94. +++++++++++++++
  95. The typographic scale is based on two Less variables in **variables.less**:
  96. `@font-size-base` and `@line-height-base`. The first is the base font-size used
  97. throughout and the second is the base line-height. We use those variables and
  98. some simple math to create the margins, paddings, and line-heights of all our
  99. type and more. Customize them and Bootstrap adapts.
  100. Emphasis
  101. --------
  102. Make use of HTML's default emphasis tags with lightweight styles.
  103. Small text
  104. ++++++++++
  105. For de-emphasizing inline or blocks of text, use the `small` tag to set text at
  106. 85% the size of the parent. Heading elements receive their own font-size for
  107. nested `small` elements.
  108. .. container:: bs-example
  109. :small:`This line of text is meant to be treated as fine print.`
  110. .. code::
  111. :class: highlight
  112. :small:`This line of text is meant to be treated as fine print.`
  113. Bold
  114. ++++
  115. For emphasizing a snippet of text with a heavier font-weight.
  116. .. container:: bs-example
  117. The following snippet of text is **rendered as bold text**.
  118. .. code::
  119. :class: highlight
  120. The following snippet of text is **rendered as bold text**.
  121. Italics
  122. +++++++
  123. For emphasizing a snippet of text with italics.
  124. .. container:: bs-example
  125. The following snippet of text is *rendered as italicized text*.
  126. .. code::
  127. :class: highlight
  128. The following snippet of text is *rendered as italicized text*.
  129. .. admonition:: :h4:`Alternate elements`
  130. :class: bs-callout bs-callout-info
  131. Feel free to use `<b>` and `<i>` in HTML5. `<b>` is meant to highlight words or
  132. phrases without conveying additional importance while `<i>` is mostly for
  133. voice, technical terms, etc.
  134. Alignment classes
  135. +++++++++++++++++
  136. Easily realign text to components with text alignment classes.
  137. .. container:: bs-example
  138. .. class:: text-left
  139. Left aligned text.
  140. .. class:: text-center
  141. Center aligned text.
  142. .. class:: text-right
  143. Right aligned text.
  144. .. class:: text-justify
  145. Justified text.
  146. .. code::
  147. :class: highlight
  148. .. class:: text-left
  149. Left aligned text.
  150. .. class:: text-center
  151. Center aligned text.
  152. .. class:: text-right
  153. Right aligned text.
  154. .. class:: text-justify
  155. Justified text.
  156. Lists
  157. -----
  158. Unordered
  159. +++++++++
  160. A list of items in which the order does *not* explicitly matter.
  161. .. container:: bs-example
  162. * Lorem ipsum dolor sit amet
  163. * Consectetur adipiscing elit
  164. * Integer molestie lorem at massa
  165. * Facilisis in pretium nisl aliquet
  166. * Nulla volutpat aliquam velit
  167. * Phasellus iaculis neque
  168. * Purus sodales ultricies
  169. * Vestibulum laoreet porttitor sem
  170. * Ac tristique libero volutpat at
  171. * Faucibus porta lacus fringilla vel
  172. * Aenean sit amet erat nunc
  173. * Eget porttitor lorem
  174. .. code::
  175. :class: highlight
  176. * Lorem ipsum dolor sit amet
  177. * Consectetur adipiscing elit
  178. ...
  179. Ordered
  180. +++++++
  181. A list of items in which the order *does* matter.
  182. .. container:: bs-example
  183. 1. Lorem ipsum dolor sit amet
  184. #. Consectetur adipiscing elit
  185. #. Integer molestie lorem at massa
  186. #. Facilisis in pretium nisl aliquet
  187. #. Nulla volutpat aliquam velit
  188. #. Faucibus porta lacus fringilla vel
  189. #. Aenean sit amet erat nunc
  190. #. Eget porttitor lorem
  191. .. code::
  192. :class: highlight
  193. 1. Lorem ipsum dolor sit amet
  194. #. Consectetur adipiscing elit
  195. ...
  196. Unstyled
  197. ++++++++
  198. Remove the default `list-style` and left margin on list items (immediate children
  199. only). **This only applies to immediate children list items**, meaning you will
  200. need to add the class for any nested lists as well.
  201. .. container:: bs-example
  202. .. class:: list-unstyled
  203. * Lorem ipsum dolor sit amet
  204. * Consectetur adipiscing elit
  205. * Integer molestie lorem at massa
  206. * Facilisis in pretium nisl aliquet
  207. * Nulla volutpat aliquam velit
  208. * Phasellus iaculis neque
  209. * Purus sodales ultricies
  210. * Vestibulum laoreet porttitor sem
  211. * Ac tristique libero volutpat at
  212. * Faucibus porta lacus fringilla vel
  213. * Aenean sit amet erat nunc
  214. * Eget porttitor lorem
  215. .. code::
  216. :class: highlight
  217. .. class:: list-unstyled
  218. * Lorem ipsum dolor sit amet
  219. * Consectetur adipiscing elit
  220. ...
  221. Inline
  222. ++++++
  223. .. container:: bs-example
  224. .. class:: list-inline
  225. * Lorem ipsum
  226. * Phasellus iaculis
  227. * Nulla volutpat
  228. .. code::
  229. :class: highlight
  230. .. class:: list-inline
  231. * Lorem ipsum
  232. * Phasellus iaculis
  233. * Nulla volutpat
  234. Description
  235. +++++++++++
  236. .. container:: bs-example
  237. A list of terms with their associated descriptions.
  238. Description lists
  239. A description list is perfect for defining terms.
  240. Euismod
  241. Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
  242. Donec id elit non mi porta gravida at eget metus.
  243. Malesuada porta
  244. Etiam porta sem malesuada magna mollis euismod.
  245. .. code::
  246. :class: highlight
  247. Description lists
  248. A description list is perfect for defining terms.
  249. Euismod
  250. Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
  251. Donec id elit non mi porta gravida at eget metus.
  252. Malesuada porta
  253. Etiam porta sem malesuada magna mollis euismod.
  254. Horizontal description
  255. ~~~~~~~~~~~~~~~~~~~~~~
  256. Make terms and descriptions in <dl> line up side-by-side. Starts off stacked
  257. like default <dl>s, but when the navbar expands, so do these.
  258. .. container:: bs-example
  259. .. class:: dl-horizontal
  260. Description lists
  261. A description list is perfect for defining terms.
  262. Euismod
  263. Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
  264. Donec id elit non mi porta gravida at eget metus.
  265. Malesuada porta
  266. Etiam porta sem malesuada magna mollis euismod.
  267. .. code::
  268. :class: highlight
  269. .. class:: dl-horizontal
  270. Description lists
  271. A description list is perfect for defining terms.
  272. Euismod
  273. Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
  274. Donec id elit non mi porta gravida at eget metus.
  275. Malesuada porta
  276. Etiam porta sem malesuada magna mollis euismod.
  277. .. admonition:: :h4:`Auto-truncating`
  278. :class: bs-callout bs-callout-info
  279. Horizontal description lists will truncate terms that are too long to fit in
  280. the left column with `text-overflow`. In narrower viewports, they will change
  281. to the default stacked layout.