Search code examples
htmlcsswhitespace

non-breaking space in link


In a subnavigation of a Website I try to have the link Suite «Mont Blanc», which was read out of the Backend to be wrapped like this:

      Suite
«Mont Blanc»

And not:

  Suite «Mont
      Blanc»

I know there is   but if I insert that in the Structure-Element Name (which is listed as a link), the link will not work properly anymore.

Is there a kind of invisible non-breakable space I could use?


Solution

  • Use like this: Demo

    CSS:

    span{
        white-space: nowrap;
    }
    

    HTML:

    Suite
    <span>«Mont Blanc» </span>
    

    EDIT:

    If you need span content in next line You can try like this: Demo

    span{
        clear:both;
        display:block;
        white-space: nowrap;
    }