当我将某些类应用于我的代码时。例如,
mt-4
、px-3
和gap-10
,它们没有任何效果。其他类别如 flex
、flex-col
、text-2xl
确实生效。这阻止了我按照我的意愿对齐元素。
<?php
// start php session
session_start();
include "../../config/dbConfig.php";
include "../partials/header.php";
?>
<body class="min-h-screen">
<div class="container mx-auto h-screen">
<main class="register_btn_container flex flex-col gap-5 items-center justify-center">
<h1 class="text-5xl font-bold">Register</h1>
<button type="button" class="bg-primary w-24 text-white shadow-md py-1 flex items-center justify-between m-10"><span class="ml-3">Join Us</span><i class="fa-solid fa-arrow-right mr-3"></i>
</button>
<button type="button" class="bg-secondary w-24 text-white shadow-md py-1 flex items-center justify-between "><span class="ml-3">Join Us</span><i class="fa-solid fa-arrow-right mr-3"></i>
</button>
<button type="button" class="bg-primary w-24 text-white shadow-md py-1 flex items-center justify-between "><span class="ml-3">Join Us</span><i class="fa-solid fa-arrow-right mr-3"></i>
</button>
</main>
<aside class="img_container">hi</aside>
</div>
</body>
</html>
考虑检查:
content
文件全局覆盖。如果 Tailwind 在扫描内容中没有“看到”类名,它不会为其生成 CSS 规则,因此类名将不起作用。