Home > front end >  How to use CSS clases with Tailwind CSS?
How to use CSS clases with Tailwind CSS?

Time:01-15

I am building a site with Next.js and Tailwind and wanted to know if there is any way you can use Tailwind CSS classes along with Next.js classes. For example:

<img src={user.picture} className="rounded"{styles.pfp}></img>

or perhaps something like

<img src={user.picture} className=`rounded{styles.pfp}`></img>

Is there any way to do that? Do let me know if there is.

CodePudding user response:

Yes, the way to do it would be like this:

<img src={user.picture} className={`rounded ${styles.pfp}`}></img>

with rounded being the Tailwind class and styles.pfp being your class.

  • Related