Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a border-only text in CSS/Javascript [duplicate]

I'm trying to reproduce this kind of text, with transparency inside of it and only a border : Example of what I'm trying to make

Is this possible to make this in CSS, even with Javascript ?

like image 284
Paul Leflon Avatar asked Apr 16 '26 04:04

Paul Leflon


2 Answers

Using text-stroke:

span {
  font-size: 8rem;
  color: black;
  -webkit-text-fill-color: transparent; /* Will override color (regardless of order) */
  -webkit-text-stroke-width: 1px;
  -webkit-text-stroke-color: black;
}
<span>ICY</span>
like image 196
Christian Carrillo Avatar answered Apr 17 '26 16:04

Christian Carrillo


You can do it by :

  color: transparent;
  -webkit-text-fill-color: transparent; /* Will override color (regardless of order) */
  -webkit-text-stroke-width: 1px;
  -webkit-text-stroke-color: white;

Reference: https://css-tricks.com/adding-stroke-to-web-text/

like image 39
2 revsKamran KB Avatar answered Apr 17 '26 16:04

2 revsKamran KB



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!