JSFiddle - React, Tailwind, and code Playground
HTML
<div class="circle">
<span id="initials"></span>
</div>
CSS
.circle {
width: 64px;
height: 64px;
border-radius: 50%;
text-align: center;
vertical-align: middle;
line-height: 64px;
background: #ccc;
font-face: Arial;
box-shadow: 1px 1px 1px #999;
font-size: 18px;
}
JavaScript
const name="Émile Paladilhe";
// using this approach as JS regex doesn't like unicode
var firstletters = '';
for (var word of name.split(' ')) {
firstletters += word.substring(0, 1);
}
document.getElementById("initials").textContent=firstletters;