Similar but different to this question: How to stop an em dash from wrapping by itself?
I have a large website, with a lot of H1
s. At the end of these headings there has to be an em dash (with no letter space between the last letter and the em dash).
I have the current code, but when the browser window is made smaller the line of text breaks before the hyphen - moving the hypen to a new line. This obviously looks terrible. Is there a way to stop this, so that the last word and the em dash move to a new line? Without having to add in span around the last word (see other post)?
h1::after {
content: "\2014";
white-space: nowrap;
}
I'm not even sure how to add the em dash: is "/2014"
the correct way to do this?
I'm using a Mac. Firefox and Safari don't break before the em dash, but Chrome does!