flex-none: Tailwind CSS Flex class

The my-2 class adds a margin of 0.5rem (8px) to the top and bottom sides of an element.


flex-none

The flex-none class prevents an element from growing or shrinking, keeping it at its intrinsic size.

Example Code

html
<div class="flex items-center justify-center">
<div class="flex-none bg-red-500 p-4 text-white font-bold rounded">flex-none</div>
</div>

Preview

flex-none

How to Use

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

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

Responsive Usage

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

html
<div class="sm:flex-none md:flex-none lg:flex-none">
Responsive element
</div>
  • sm:flex-none — applies from 640px and up
  • md:flex-none — applies from 768px and up
  • lg:flex-none — 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