container.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. ---
  2. layout: documentation
  3. doc-tab: layout
  4. doc-subtab: container
  5. ---
  6. {% include subnav-layout.html %}
  7. <section class="section">
  8. <div class="container">
  9. <h1 class="title">Container</h1>
  10. <h2 class="subtitle">
  11. A simple <strong>container</strong> to center your content horizontally
  12. </h2>
  13. <hr>
  14. <div class="content">
  15. <p>The <code>.container</code> class can be used in any context, but mostly as a <strong>direct child</strong> of either:</p>
  16. <ul>
  17. <li><code>.header</code></li>
  18. <li><code>.hero</code></li>
  19. <li><code>.section</code></li>
  20. <li><code>.footer</code></li>
  21. </ul>
  22. <p>On <strong>mobile</strong> and <strong>tablet</strong>, the container will have a margin of <strong>20px</strong> on both the left and right sides.</p>
  23. <p>On <strong>desktop</strong> (> 980px), the container will have a maximum width of <strong>960px</strong> and will be <strong>horizontally centered</strong>.</p>
  24. </div>
  25. </div>
  26. <div class="example">
  27. <div class="container">
  28. <div class="notification">
  29. This container is <strong>centered</strong> on desktop.
  30. </div>
  31. </div>
  32. </div>
  33. {% highlight html %}
  34. <div class="container">
  35. <div class="notification">
  36. This container is <strong>centered</strong> on desktop.
  37. </div>
  38. </div>
  39. {% endhighlight %}
  40. <div class="container">
  41. <hr>
  42. <h3 class="title">Fluid container</h3>
  43. <div class="content">
  44. <p>If you don't want to have a maximum width but want to keep the 20px margin on the left and right sides, add the <code>is-fluid</code> modifier:</p>
  45. </div>
  46. </div>
  47. <div class="example is-fullwidth">
  48. <div class="container is-fluid">
  49. <div class="notification">
  50. This container is <strong>fluid</strong>: it will have a 20px gap on either side.
  51. </div>
  52. </div>
  53. </div>
  54. {% highlight html %}
  55. <div class="container is-fluid">
  56. <div class="notification">
  57. This container is <strong>fluid</strong>: it will have a 20px gap on either side, on any viewport size.
  58. </div>
  59. </div>
  60. {% endhighlight %}
  61. </section>