Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to have a bordered text in tailwind

I need the text to have a black border.

I tried this,

  <div className="font-bold text-2xl text-white outline-4">
    Hello
  </div>

But it doesn't seem put a border to the text.

like image 805
Sai Krishnadas Avatar asked Dec 01 '25 20:12

Sai Krishnadas


1 Answers

I found a custom tailwind drop shadow yields the best result:

drop-shadow-[0_1.2px_1.2px_rgba(0,0,0,0.8)]

Just adjust the pixel values and intensity, and use as standard tailwind attribute.

This even works on svgs.

You can check out what an example looks like here

like image 76
Philipp John Avatar answered Dec 03 '25 10:12

Philipp John



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!