user6467650 user6467650 - 3 months ago 21
CSS Question

How to prevent splitting of anchor tag text across two lines while resizing?

I have an anchor tag where I display the name of the person logged in. The problem is that when I resize the browser window, the name gets split across two lines. How to prevent it?

Answer Source

Check out this JSFiddle.


<a href="" class="dontwrap"> Ricky Dam </a>


.dontwrap {
  white-space: nowrap;