Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to use css clases with tailwind css?

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 Nextjs 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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading