Demo: http://jsfiddle.net/rJXE3/3/
HTML
<p>This text contains a <span class="stressed"><span class="somemagic">highlighted</span>stressed phrase</span> within it.</p>
CSS
.somemagic {
display: inline-block;
position: absolute;
width: 100%;
height: 100%;
text-align: center;
bottom: 100%;
white-space: nowrap;
margin-left: -25px; // Adjust this if stressed text size varies
}
.stressed {
position: relative;
}
To prevent overlapping, ensure to add margin to your "p" element or include an additional line break.
UPDATE 2
Demo: http://jsfiddle.net/rJXE3/4/
Another CSS configuration option has been discovered that eliminates the need for JavaScript.
.somemagic {
display: inline-block;
position: absolute;
width: 300%;
height: 100%;
text-align: center;
bottom: 100%;
white-space: nowrap;
left: -100%;
}
.stressed {
position: relative;
}