m-0: Tailwind CSS Margin class

The m-0 class removes all margin from an element.


m-0 (Margin 0)

The m-0 class removes all margin from an element.

Example Code

html
<div class="rounded-t-md bg-gray-100 flex items-center justify-center p-5">
<div class="bg-gray-300 w-40 h-28 rounded">
<div class="m-0 bg-gray-600 text-white font-bold text-center rounded">
M-0
</div>
</div>
</div>

Preview

M-0

How to Use

Add the m-0 class directly to your HTML element:

html
<div class="m-0">
<!-- Your content here -->
</div>

Responsive Usage

Use Tailwind's responsive prefixes to apply m-0 at specific breakpoints:

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