Tailwind CSS Min-Width

In tailwind CSS, this class accepts a large number of values, and all of the properties are covered in class form. It's a replacement for the CSS min-width property. This class is used to specify an element's minimum width. The width value must be greater than or equal to the min-width value. Min-width preserves the set minimum width even if the content supplied within the element is lower.

Min-Width Classes

  • min-w-0: This class is used to specify the min-width length.
  • min-w-full: This class is used to set the min-width length to its maximum capacity.
  • min-w-min: This class is used to set the minimum capacity length of min-width.
  • min-w-max: This class is used to set the maximum capacity of min-width.

Syntax:

<element class="min-w-0">...</element>

Code:

<!DOCTYPE html>
<head>
    <link href=
"https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css"
          rel="stylesheet">
</head>
<body class="text-center mx-4 space-y-2">
    <h1 class="text-red-600 text-5xl font-bold">
       Tutorial and Example
    </h1>
    <b>Min-Width Class - Tailwind CSS </b>
    <div class="w-24 h-16 min-w-full md:min-w-0
                bg-red-400 rounded-lg text-white">
    </div>
</body>
</html>

Output:

Tailwind CSS Min-Width