【发布时间】:2021-06-06 19:24:49
【问题描述】:
使用 TailwindCSS,我试图让 <div> 适合其孩子的高度,即 <button>。我的代码如下:
<form className="w-full flex h-96 gap-2 mt-8 flex-wrap">
<textarea
role="text-input"
className="resize-none flex-1"
placeholder="INPUT"
/>
<textarea
role="text-output"
className="resize-none flex-1"
placeholder="OUTPUT"
readOnly
/>
<div className="w-full flex flex-none"> // This is the troublesome div
<button>
Submit!
</button>
</div>
</form>
通读the docs 并进行谷歌搜索我似乎找不到这样做的方法,理想情况下我想设置一个类,例如h-fit-content(类似这样)但它没有似乎存在。
提前致谢!
【问题讨论】:
标签: css reactjs tailwind-css