If you are using vite bundler and version@3 so you have to run these 2 commands
npm install -D tailwindcss@3 postcss autoprefixer
npx tailwindcss init -p
after this there is file name postcss.config.js than add in content
content: ["./src/**/*.{js,ts,jsx,tsx}"],
your problem will solve!