📜  bootstrap row no-wrap (1)

📅  最后修改于: 2023-12-03 15:13:41.623000             🧑  作者: Mango

Bootstrap Row No-wrap

Bootstrap Row No-wrap is a class in Bootstrap that allows you to keep the contents of a row on a single line, preventing elements from wrapping onto the next line. This is useful when working with content that needs to stay in a specific order or when using components like carousels or sliders.

To use the Row No-wrap class, simply add the .no-wrap class to your row element.

<div class="row no-wrap">
  <div class="col-sm-4">Column 1</div>
  <div class="col-sm-4">Column 2</div>
  <div class="col-sm-4">Column 3</div>
</div>

In the code snippet above, we have a row element with three columns, each taking up 4 columns (out of a possible 12) on small screens and up.

By adding the .no-wrap class to the row element, we ensure that these columns stay on a single line, even if the screen size is too small to accommodate all three columns side-by-side.

Additional Information
  • You can specify the screen sizes at which the .no-wrap class applies by using the appropriate responsive classes in conjunction with the .no-wrap class. For example, you could use .no-wrap .d-md-flex to apply the no-wrap behavior to screen sizes medium and up.
  • In addition to the .no-wrap class, Bootstrap also provides a .flex-nowrap class that achieves a similar effect for Flexbox-based layouts.