简体   繁体   English

顺风CSS不改变网页

[英]tailwind css not changing the webpage

I wan to to use the tailwind css framework for the first time, I tried to follow the tutorial on their page as close as possible, but it is not making any changes to my webpage and I don't know why.我想第一次使用 tailwind css 框架,我尝试尽可能接近他们页面上的教程,但它没有对我的网页进行任何更改,我不知道为什么。 Since I am very inexperieneced, I guess I have missed installing or doing something, since it is my first time using a framework for my project.由于我非常缺乏经验,我想我错过了安装或做某事,因为这是我第一次为我的项目使用框架。 Also I have started using Visual Studio Code for my first time and I am a bit overwhelmed how everything works.此外,我第一次开始使用 Visual Studio Code,我对一切的工作方式感到有些不知所措。

What I have got for now:我现在有什么:

Installed node.js, since I read somewhere I need it for tailwind css, seems to work node --version command sends result.安装了 node.js,因为我在某个地方读到了我需要它用于顺风 css,似乎可以工作node --version命令发送结果。

Installed tailwind css in my project folder (project folder is inside HTDOCS folder from XAMPP) with npx tailwindcss init in the vs terminal, after changing directories to my project folder.将目录更改为我的项目文件夹后,在我的项目文件夹中安装了 tailwind css(项目文件夹位于 XAMPP 的 HTDOCS 文件夹内),在 vs 终端中使用 npx tailwindcss init Now I also have a node_modules folder and a tailwind.config.js there现在我还有一个 node_modules 文件夹和一个 tailwind.config.js

Addet添加

<link rel="stylesheet" href="style.css" type="text/css">

in my home.html and在我的 home.html 和

@tailwind base;
@tailwind components;
@tailwind utilities;

to my style.css到我的 style.css

Then I tried to add然后我尝试添加

class="bg-green-500"

to my body in home.html and it is shown in the editor, but not on the website...我在 home.html 中的身体,它显示在编辑器中,但不在网站上...

What am I missing ?我错过了什么? Thanks for help.感谢帮助。

You should follow the official setup guide: Get started with Tailwind CSS您应该遵循官方设置指南: Tailwind CSS 入门

From your description, you might have not followed the build step:根据您的描述,您可能没有遵循构建步骤:

Run the CLI tool to scan your template files for classes and build your CSS: npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch运行 CLI 工具来扫描类的模板文件并构建 CSS: npx tailwindcss -i ./src/input.css -o ./dist/output.css --watch

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM