CSS-overview.txt 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. Overview
  2. ===============================================================================
  3. .. lead::
  4. Get the lowdown on the key pieces of Bootstrap's infrastructure, including
  5. our approach to better, faster, stronger web development.
  6. HTML5 doctype
  7. -------------
  8. Bootstrap makes use of certain HTML elements and CSS properties that require
  9. the use of the HTML5 doctype. Include it at the beginning of all your projects.
  10. .. code:: html
  11. :class: highlight
  12. <!DOCTYPE html>
  13. <html lang="en">
  14. ...
  15. </html>
  16. Mobile first
  17. -------------
  18. With Bootstrap 2, we added optional mobile friendly styles for key aspects of
  19. the framework. With Bootstrap 3, we've rewritten the project to be mobile
  20. friendly from the start. Instead of adding on optional mobile styles, they're
  21. baked right into the core. In fact, **Bootstrap is mobile first**. Mobile first
  22. styles can be found throughout the entire library instead of in separate files.
  23. To ensure proper rendering and touch zooming, **add the viewport meta tag** to
  24. your :code:`<head>`.
  25. .. code:: html
  26. :class: highlight
  27. <meta name="viewport" content="width=device-width, initial-scale=1">
  28. You can disable zooming capabilities on mobile devices by adding
  29. :code:`user-scalable=no` to the viewport meta tag. This disables zooming,
  30. meaning users are only able to scroll, and results in your site feeling a bit
  31. more like a native application. Overall, we don't recommend this on every site,
  32. so use caution!
  33. .. code:: html
  34. :class: highlight
  35. <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  36. Typography and links
  37. --------------------
  38. Bootstrap sets basic global display, typography, and link styles. Specifically,
  39. we:
  40. * Set :code:`background-color: #fff`; on the body
  41. * Use the :code:`@font-family-base`, :code:`@font-size-base`, and
  42. :code:`@line-height-base` attributes as our typographic base
  43. * Set the global link color via :code:`@link-color` and apply link underlines
  44. only on :hover
  45. These styles can be found within :code:`scaffolding.less`.
  46. Normalize.css
  47. -------------
  48. For improved cross-browser rendering, we use `Normalize.css
  49. <http://necolas.github.io/normalize.css/>`_, a project by `Nicolas Gallagher
  50. <https://twitter.com/necolas>`_ and `Jonathan Neal <https://twitter.com/jon_neal>`_.
  51. Containers
  52. ----------
  53. Easily center a page's contents by wrapping its contents in a
  54. .container. Containers set width at various media query breakpoints to match
  55. our grid system.
  56. Note that, due to padding and fixed widths, containers are not nestable by
  57. default.
  58. .. code::
  59. :class: highlight
  60. .. container::
  61. ...