Complete the code to add Tailwind CSS to a Next.js project by importing the CSS file.
import '[1]'; export default function App({ Component, pageProps }) { return <Component {...pageProps} />; }
In Next.js, Tailwind CSS is usually imported in the globals.css file inside the styles folder.
Complete the code to create a responsive container using Tailwind CSS in a Next.js component.
<div className="[1]"> <h1 className="text-2xl font-bold">Welcome to Next.js with Tailwind!</h1> </div>
The container mx-auto px-4 classes create a centered responsive container with horizontal padding.
Fix the error in the Tailwind class usage to make the button have a blue background and light blue text.
<button className="bg-[1]-500 text-[2]-100 px-4 py-2 rounded"> Click me </button>
The correct Tailwind color for a blue background is bg-blue-500 and for white-ish text is text-blue-100.
Fill both blanks to create a flex container that centers items vertically and horizontally.
<div className="flex [1] [2] h-screen"> <p className="text-lg">Centered content</p> </div>
Using justify-center centers items horizontally and items-center centers items vertically in a flex container.
Fill all three blanks to create a Next.js page with a responsive header using Tailwind CSS.
export default function Home() {
return (
<header className="bg-[1]-600 p-[2]">
<h1 className="text-[3]-100 text-3xl font-semibold">My Next.js Site</h1>
</header>
);
}The header has a blue background with padding 6 and gray text for good contrast.