【发布时间】:2021-06-09 17:06:49
【问题描述】:
因此,我正在尝试创建一张卡片,其右侧为信息,左侧为紫色(如果已选中)。我正在使用 Next 和 TailwindCSS。
这是我渲染卡片的父组件:
{files ? (
<div className="ml-6 mt-8 absolute">
{files.map((value) => {
return <FileCard key={value.id} file={value} />
})}
</div>
) : (
<div>graphql not working :(</div>
)}
这是 FileCard 组件:
return (
<div className="flex justify-content items-center mb-4 w-72 bg-white rounded-lg shadow-lg relative">
<div className="h-full w-2 bg-indigo-600 relative rounded-l-lg"></div> <- // here the h-full not working
<div className="py-4 px-4 flex justify-between items-center">
<div className="flex flex-col justify-center align-start text-sm font-bold">
<p>{file.title}</p>
<p className="text-xs">Last updated: {date.toString()}</p>
</div>
</div>
</div>
)
预期结果:
实际结果:
如果我用h-20 硬编码高度:
【问题讨论】:
标签: html css reactjs tailwind-css