In HTML, how to word-break on a dash? *

Question

Given a relatively simple CSS:

<div style="width:150px;">
  12333-2333-233-23339392-332332323
</div>

How do I make it so that the string stays constrained to the width of 150, and simply wraps to a newline on the hyphen?

Answer

Replace your hyphens with this:

&shy;

It's called a "soft" hyphen.

< br > via < a class="StackLink" href=" http://stackoverflow.com/questions/904/" >In HTML, how to word-break on a dash?< /a>
Share on Google Plus

About Cinema Guy

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment