我用的是“@角/cli”:"~13.3.0","primeflex":"^3.1.3",
我已经安装好了
npm install primeflex --save然后添加到angular.json文件中。
"node_modules/primeflex/primeflex.css"我的Html如下:
<div class="card">
<div class="card-container yellow-container overflow-hidden">
<div class="flex">
<div class="flex align-items-center justify-content-center bg-yellow-500 font-bold text-gray-900 m-2 px-5 py-3 border-round">Prime</div>
<div class="flex align-items-center justify-content-center bg-yellow-500 font-bold text-gray-900 m-2 px-5 py-3 border-round">Prime and PrimeFlex</div>
<div class="flex align-items-center justify-content-center bg-yellow-500 font-bold text-gray-900 m-2 px-5 py-3 border-round">Lorem ipsum dolor sit amet</div>
</div>
<div class="flex">
<div class="flex-1 flex align-items-center justify-content-center bg-yellow-500 font-bold text-gray-900 m-2 px-5 py-3 border-round">Prime</div>
<div class="flex-1 flex align-items-center justify-content-center bg-yellow-500 font-bold text-gray-900 m-2 px-5 py-3 border-round">Prime and PrimeFlex</div>
<div class="flex-1 flex align-items-center justify-content-center bg-yellow-500 font-bold text-gray-900 m-2 px-5 py-3 border-round">Lorem ipsum dolor sit amet</div>
</div>
</div>
</div>但是,div对齐正确,没有颜色和样式,具体如下:
知道会有什么问题吗?
发布于 2022-04-02 22:28:12
您的代码正在工作,但缺少一个主题,这就是为什么您可以看到间隔,但没有颜色。
我被困了一段时间,然后在文档上读到它不带颜色,所以您需要添加一个主题,在添加一个主题之后,您可以在这里看到颜色https://stackblitz.com/edit/angular-ivy-gtnzrg?file=src%2Fstyles.css。
但是在index.css上增加了我的
https://stackoverflow.com/questions/71720337
复制相似问题