0

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"

1
  • 4
    You can't do this in CSS. CSS is a styling language that can do minimal computations. In this case, you should try to use Javascript. Commented Jul 25, 2020 at 0:26

2 Answers 2

1

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>

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.