I have a fixed width div, containing a bunch of links, each one has text with non breaking spaces between the words.
What I am trying to achieve, is that when a link hits the edge of the div the whole link moves down a line.
I was just playing about in JSFiddle,and initially I had one long unformatted (no tags on new lines, etc) piece of html, and was observing the final link not moving onto a new line.
I then decided to reformat, so put new tags on lines, and after doing so, the final tag now moves onto a new line when it gets restricted by the width of the div.
I am actually generating the html dynamically from a script, and at present it just produces a single concatenated string for me to then render. Here is the HTML I am using and a working fiddle showing the results of both approaches:
http://jsfiddle.net/8gdez8ur/2/
<div style="width: 350px; overflow: hidden;"><a href="#" action="zoom" style="font-size:11px;padding-right:2px;">Zoom</a><a action="streetview" href="#" style="font-size:11px;padding-right:2px;"> Street View</a><a action="addplacemarker" href="#" style="font-size:11px;padding-right:2px;">Add Placemarker</a><a action="route" href="#" style="font-size:11px;padding-right:2px;">ETA To</a><a action="reportproblem" href="#" style="font-size:11px;padding-right:2px;">Incorrect Location Details</a><a action="sendmessage" href="#" style="font-size:11px;">Send Message</a></div>
<hr>
<div style="width: 350px; overflow: hidden;">
<a href="#" action="zoom" style="font-size:11px; padding-right:2px;">Zoom</a>
<a action="streetview" href="#" style="font-size:11px; padding-right:2px;">Street View</a>
<a action="addplacemarker" href="#" style="font-size:11px; padding-right:2px;">Add Placemarker</a>
<a action="route" href="#" style="font-size:11px; padding-right:2px;">ETA To</a>
<a action="reportproblem" href="#" style="font-size:11px; padding-right:2px;">Incorrect Location Details</a>
<a action="sendmessage" href="#" style="font-size:11px; padding-right:2px;">Send Message</a>
</div>
Why is there a difference in behaviour here? Thanks