2

I want to make sure that the date 2012-13-12 always ends up on one line. If I use / as a date separator it works but the '-'-sign (not very surprised) makes the date end up on two rows.

<div class="someclass">
      around  lorem Ipsium lorem Ipsium 2012-13-12 lorem Ipsium lorem Ipsium 
</div>

and

.someclass { width:40mm; }

http://jsfiddle.net/yjK6D/

Any suggestions?

Sven Persson
  • 71
  • 1
  • 6

1 Answers1

6

use css with "white-space:nowrap;"

or (older method) use tag "nobr" example 1:

<style type='text/css'>
    .nobr { white-space:nowrap; }
</style>
<div>
around  lorem Ipsium lorem Ipsium  around  lorem Ipsium lorem Ipsium <span class='nobr'> 2012-13-12 </span>lorem Ipsium lorem Ipsium 
</div>

example two:

<div>
    around  lorem Ipsium lorem Ipsium  around  lorem Ipsium lorem Ipsium <nobr> 2012-13-12 </nobr>lorem Ipsium lorem Ipsium 
</div>
Guy Dafny
  • 1,709
  • 1
  • 14
  • 25