flex-nowrap: Tailwind CSS Flex class

The flex-nowrap class prevents flex items from wrapping, keeping them on a single line.


flex-nowrap

The flex-nowrap class prevents flex items from wrapping, keeping them on a single line.

Example Code

html
<div class="flex flex-nowrap items-center justify-center p-5 text-white font-bold">
<div class="bg-green-500 p-4 m-2 rounded">flex-nonwrap</div>
<div class="bg-green-500 p-4 m-2 rounded">flex-nonwrap</div>
<div class="bg-green-500 p-4 m-2 rounded">flex-nonwrap</div>
</div>

Preview

flex-nonwrap
flex-nonwrap
flex-nonwrap

How to Use

Add the flex-nowrap class directly to your HTML element:

html
<div class="flex-nowrap">
<!-- Your content here -->
</div>

Responsive Usage

Use Tailwind's responsive prefixes to apply flex-nowrap at specific breakpoints:

html
<div class="sm:flex-nowrap md:flex-nowrap lg:flex-nowrap">
Responsive element
</div>
  • sm:flex-nowrap — applies from 640px and up
  • md:flex-nowrap — applies from 768px and up
  • lg:flex-nowrap — applies from 1024px and up

Customization

You can extend or override this utility in your tailwind.config.js. See the Tailwind CSS documentation for details on customizing your theme.

Windframe is an AI visual editor for rapidly building stunning web UIs & websites

Start building stunning web UIs & websites!

Build from scratch or select prebuilt tailwind templates