Like you see in inspector, you defined only border color but not border width. Because it is 0px, it is invisible ;)
You need to change it to
class="border border-gray-800"
"border" will by default mean border-width: 1px so if you need thicker use for example
class="border-2 border-gray-800"
or if you wanna it only on one side
class="border-right border-gray-800"
More in documentation.
Answer from chojnicki on Stack OverflowI'm a beginner to Tailwind, so it's likely something simple. I can see an <input type="text" class="border border-solid border-2 border-indigo-600">, but only a faint 1px border of #e5e7eb shows up. I can see that this is under the *, ::before, ::after rule at the top of the stylesheet. My config file is customized only for the content paths, and theme and extend are empty. I read quite a bit of the Tailwind documentation, but I'm having a lot of trouble wrapping my head around how basics like color intersect with border, background, and text seeing as the latter three all incorporate color.
Hi all,
I am working on a form and my inputs lack borders, though they should. Borders are working with buttons, but not with inputs.
<inputname="name"id="name"value="John"type="text"className="block w-full border-2 border-solid border-gray-800 rounded-md shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"/>
What could the issue be?
EDIT: the border works on focus.
Like you see in inspector, you defined only border color but not border width. Because it is 0px, it is invisible ;)
You need to change it to
class="border border-gray-800"
"border" will by default mean border-width: 1px so if you need thicker use for example
class="border-2 border-gray-800"
or if you wanna it only on one side
class="border-right border-gray-800"
More in documentation.
Nothing was working for me until I added the border-style: solid using border-solid. I had to explicitly set border-0 though, else it will be applied to all directions.
<div className="border-0 border-b-2 border-solid border-b-red-600">Bottom border</div>
I am using "tailwindcss": "^3.3.3"
I'm using the tab component from tailwind elements on a project i'm working on but I'm really struggling to change the bottom border color on the active tab (i.e. the tab you click to view the contents of the tab).
https://tailwind-elements.com/docs/standard/navigation/tabs/#section-related-resources
Whatever I try, the bottom border remains blue!
Does anyone have any idea where I can change it?
Design systems are getting better and more standardized these days, but honestly… I still find myself typing a lot of custom values in Tailwind — like w-[2px], h-[234px], border-[1px], that kind of thing.
It’s not a huge deal, but when it happens often, it breaks your flow. So I ended up making a tiny VSCode extension that helps me speed that part up a bit.
-
w-[2px] -
h-[200px] -
mt-[10vh]
It’s not a big deal, but when you’re doing it constantly, it adds up.
So I made a tiny VSCode extension that lets you type shorthands like:
-
w2p→w-[2px] -
h200p→h-[200px] -
mt10vh→mt-[10vh]
Just something I threw together to save a few keystrokes. Might be useful if you do a lot of custom utility work.
🔗 tw-auto-bracket on VSCode Marketplace
Would love to hear if anyone else has little tricks or extensions they use for Tailwind. Always looking to improve the workflow 🙌
Hello as titel says, they dont work.
Im following a guide and in the guide they work. But for example if i try to make a list with a border or add scroll margin with scroll-mt-20, Nothing happens .
Example:
<section id="rockets" class="p-6 my-12 scroll-mt-20">
-- This scroll-mt-20 does nothing.
<li class="w-2/3 sm:w-5/6 flex flex-col items-center border border-solid border-slate-900 dark:border-gray-100 bg-white py-6 px-2 rounded-3xl shadow-xl dark:bg-black"></li>
-- This does not get a border.
I know some differences between them. Border affects the layout, outline, and rings are drawn outside.
However, when you want to style an element, what is your go-to option if you don't have a layout constraint.
Hey there,
I'm trying to make a grid with borders between and around each element. To do this I am using divide and border class names. But I get overlap... here's a playground of what I am doing: https://play.tailwindcss.com/jVJYK17UiP. Any tips? Thanks!!!
Hi, i was wondering if there is a way to define a default border color so i only need to apply the border class and not have to also add the border-[color].
Thanks!