JSFiddle - React, Tailwind, and code Playground

HTML

<div id="wrap">
    <h1>Specialists in retirement income</h1>
</div>

CSS

body { background:#ddd; }
#wrap { width:400px; background:white; }

h1 {
    
    color: #fff;
    background: #41a293;
    padding: 2px 4px; 
    display: inline;
    word-spacing:10px;
    font: 30px/1.4 Arial, sans-serif;
    white-space : pre-wrap;
}
span {
    display:inline-block;
    text-indent:4px;
}

JavaScript

$('h1').each(function(index, element) {
    var heading = $(element), word_array, last_word, first_part;

    word_array = heading.html().split(/\s+/); // split on spaces
    last_word = word_array.pop();             // pop the last word
    first_part = word_array.join(' ');        // rejoin the first words together

    heading.html([first_part, ' <span>', last_word, '</span>'].join(''));
});