#Tailwind border property not working

2 messages · Page 1 of 1 (latest)

hearty kelp
#

When I apply border styles directly on a div, it works fine. When I apply the styles in globals.css and add it as a className, the border styles do not apply but only bg color is working. I'm wondering what is wrong with the definition. any help is appreciated!

timber cave
#

Hello @hearty kelp!
First, make sure you're using the right names in your **Tailwind CSS classes **for those borders. It's a bit like choosing the right tool for the job. If you want a border all around, go for border, and if you just need it on the top, pick border-t. Think of it like selecting the right brush for painting.

Imagine your CSS styles are like a recipe. You want to ensure that your global CSS styles are added after your Tailwind CSS styles in your HTML document. It's a bit like adding the final touch of seasoning to a dish – if you do it too soon, it might not have the intended flavor. So, in your code, let Tailwind have the last word, and your border styles should work just fine.

Please can you can provide more specific information about your global CSS class and how it's applied to the element? cat_smile