d3f964d6d76442cb411cbae6322b50961c2f9b84.svn-base 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ---
  2. layout: docs
  3. title: Flexbox
  4. group: getting-started
  5. ---
  6. Flexbox support has finally come to Bootstrap. Opt-in to the new CSS layout styles with the flick of a variable or the swap of a stylesheet.
  7. ## Contents
  8. * Will be replaced with the ToC, excluding the "Contents" header
  9. {:toc}
  10. ## What's included
  11. Flexbox support is available for a number of Bootstrap's components:
  12. - The entire grid system (mixins and predefined classes), which switch from `float`s to `display: flex;`.
  13. - Input groups, which move from `display: table;` to `display: flex;`.
  14. - The media component moves from `display: table;` and a number of hacky styles to a simple `display: flex;`.
  15. Vendor prefixes are provided in our compiled CSS with Autoprefixer via Grunt.
  16. ## Why flexbox?
  17. In a nutshell, flexbix provides simpler and more flexible layout options in CSS. More specifically, it provides:
  18. - Easy vertical alignment of content within a parent element.
  19. - Easy reordering of content across devices and screen resolutions with the help of media queries.
  20. - Easy CSS-only equal height columns for your grid-based layouts.
  21. All these things are possible outside flexbox, but typically require extra hacks and workarounds to do right.
  22. ## How it works
  23. If you're familiar with modifying variables in Sass—or any other CSS preprocessor—you'll be right at home to move into flexbox mode.
  24. 1. Open the `_variables.scss` file and find the `$enable-flex` variable.
  25. 2. Change it from `false` to `true`.
  26. 3. Recompile, and done!
  27. Alternatively, if you don't need the source Sass files, you may swap the default Bootstrap compiled CSS with the compiled flexbox variation. [Head to the download page](/getting-started/download) for more information.
  28. ## Browser support
  29. Enabling flexbox means **reduced browser and device support:**
  30. - Internet Explorer 9 and below do not support flexbox.
  31. - Internet Explorer 10 has a few known quirks.
  32. Please be extra conscious of your user base when enabling flexbox in your project.