I know in plain css you can set the min and max width. but when I try min-h-10 and max-h-10 it doesn’t do anything in tailwind.
So this is what I have:
<body>
<div class="flex-col justify-center">
<div class="h-10 w-10 border bg-blue-300 block">
h
</div>
</div>
</body>
3
Answers
In TailwindCSS you can set your custom values like this:
Values like
min-h-10
andmax-h-10
aren’t valid values in Tailwind CSS, the only valid values aremin-h-0
,min-h-full
,min-h-screen
,min-h-min
,min-h-max
,min-h-fit
.So, the only way to use values like
min-h-10
is by using custom values where you can customize yourmin-height
scale by editingtheme.minHeight
ortheme.extend.minHeight
in yourtailwind.config.js
file like take the following example.Your
tailwind.config.js
file:Your code:
See the playground
Or if you need to use a one-off
min-height
value that doesn’t make sense to include in your theme, you can use arbitrary values like below:See the playground