I have a paragraph which consists of lots of names (forename and surname) listed as a large block "Mike Wilson; Jill Bradshaw; Janet Thomas;" etc. I want to prevent the names breaking between forename and surname, while allowing breaking after the ";" separator.
In an HTML file I've defined a span class with "white-space: nobreak;" and each name is enclosed in <span class="nobreak">John Smith;</span>
The operative code is
<style>
<!-- when wrapping lines, don't break names between forename(s) and surname -->
span.nobreak { display: inline; white-space: nowrap; }
</style>
and
<span class="nobreak">Jane Absolom;</span>
<span class="nobreak">David Adamson;</span>
This has no effect: names still break between Jane and Absolom if they happen to occur at the end of a line.
The annoying thing is that I'm sure this used to work a year or so ago, and the only changes I've made to the page since then (AFAIK) are to add more names enclosed in span tags.
The live page is https://buckinghamshireremembers.org.uk/acknowledgements body.htm ("Individuals" section).
In an HTML file I've defined a span class with "white-space: nobreak;" and each name is enclosed in <span class="nobreak">John Smith;</span>
The operative code is
<style>
<!-- when wrapping lines, don't break names between forename(s) and surname -->
span.nobreak { display: inline; white-space: nowrap; }
</style>
and
<span class="nobreak">Jane Absolom;</span>
<span class="nobreak">David Adamson;</span>
This has no effect: names still break between Jane and Absolom if they happen to occur at the end of a line.
The annoying thing is that I'm sure this used to work a year or so ago, and the only changes I've made to the page since then (AFAIK) are to add more names enclosed in span tags.
The live page is https://buckinghamshireremembers.org.uk/acknowledgements body.htm ("Individuals" section).