Zero width word joiner and CSS generated content

ARswichenic

New Member
I want to disallow line breaks in some places in a web page (eg. it's really ugly when the browser breaks the text "100 km/h" on two lines - in this question I'm concerned about breaking near the "/"). I tried this approach and it works\[code\]x&zwj;/&zwj;y <!-- x/y on one line -->\[/code\]The entity \[code\]&zwj;\[/code\] is a zero-width word joiner, similar to \[code\]&nbsp;\[/code\], but without space.However, I am concerned about a slightly more complex example:\[code\]x&zwj;/<span class="someclass"></span>\[/code\]with style:\[code\].someclass { content: "y"; }\[/code\]This seems to work in Firefox (no linebreaks between normal and generated content), but in Opera, it fails. Should this work according to the standards?
 
Top