Suliman
Suliman

Reputation: 1

How to put blank space between two specific characters in CSS

Is it possible to add blank space between specific letters using CSS?

What I have: UnitedKingdom

What I want: United Kingdom

Ideally, I want to read the text using CSS and if I found "UnitedKingdom" then replace it with "United Kingdom"

Upvotes: 0

Views: 945

Answers (2)

Marcelo Serra
Marcelo Serra

Reputation: 1

Maybe some workaround using attr() and :after on CSS could work, but would be much better using Javascript.

Upvotes: 0

anshul
anshul

Reputation: 3111

You could use the letter-spacing property with CSS, and place the last letter of United (d) in a span with a class that makes it space out.

span{
  letter-spacing: 5px;
}
<p>
 Unite<span>d</span>Kingdom
</p>

Upvotes: 1

Related Questions