I am having troubles using the XAMPP server for Tailwindcss in PHP
我在PHP中使用Tailwindcss的XAMPP服务器时遇到问题
PHP code
PHP代码
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="styles.css" />
<title>Hello, World!</title>
</head>
<body class="w-4/5 mx-auto p-10">
<?php
echo '<h1 class="text-green-700 text-3xl font-bolder">Hello Momo! </h1> <a href="index.html">goto html</a>'
?>
</body>
</html>
Tailwind setup
顺风设置
/** @type {import('tailwindcss').Config} */
module.exports = {
content: ["*.php"],
theme: {
extend: {},
},
plugins: [],
}
The code above works well on my phone using and editor called CodeSnack but when I run same code on XAMPP server, the tailwindcss class doesn’t apply to the document
上面的代码在我的手机上使用名为CodeSnack的编辑器运行得很好,但当我在XAMPP服务器上运行相同的代码时,tailwindcss类不适用于文档
更多回答
Consider checking that the styles.css
file is being served by the XAMPP server.
请考虑检查styles.css文件是否由XAMPP服务器提供服务。
Please how do I do that
请问我该怎么做
Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
请澄清您的具体问题或提供更多详细信息,以突出您的需求。正如目前所写的,很难准确说出你在问什么。
Check that the styles.css
is in the file directory served by XAMPP. Check that style.css
is the correct location such that the <link>
tag references it.
检查styles.css是否在XAMPP提供的文件目录中。检查style.css的位置是否正确,以便<link>标记引用它。
They only clarification I can add is a picture of the output, the Tailwindcss classes is not being applied like a normal css
我能添加的唯一澄清是输出的图片,Tailwindcss类没有像普通css那样应用
优秀答案推荐
place CDN firstly in the head tag ()
将CDN首先放在head标签中()
更多回答
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
您的回答可以通过其他支持信息得到改进。请编辑以添加更多详细信息,如引文或文档,以便其他人可以确认您的答案是正确的。你可以在帮助中心找到更多关于如何写出好答案的信息。
我是一名优秀的程序员,十分优秀!