Your best bet here would be to use <WBR>
tag or ​
character to introduce a soft-break wherever you wish. e.g.:
Demo: http://jsfiddle.net/abhitalks/sbg8G/15/
HTML:
...
<a href="[email protected]">
big.ass.email@​address-is​.extremely.lame.de
</a>
...
Here, ​
is inserted after the "@" and after "-is" to cause a break at those points.
Important: word-wrap
and word-break
won't help you here.
Reason:
word-break
is meant for CJK (Chinese, Japanse, Korean) texts. (Reference). Its main purpose is to prevent word breaks for CJK text. Rest is normal.
word-wrap
is used to specify whether or not the browser may break lines within words in order to prevent overflow. That's it. (Reference) The main thing to notice is that "..normally unbreakable words may be broken at arbitrary points.. ". Arbitrary points don't give you much control, do they?
Hard-hyphens help to indicate the break points. You have a hyphen in your email address and that gives a hint to break word there.
Note:
A better alternative would be have CSS3 do it for us. word-wrap
and word-break
doesn't allow control of break points. hyphens
does, but, unfortunately hyphens
still "is an experimental technology".
Ref: https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens
hyphens
should be able to do the trick along with:
hyphenate-limit-lines
hyphenate-limit-zone
hyphenate-character
hyphenate-limit-before
But, this doesn't work currently as it should. Otherwise, a ­
would have helped you out.
Note 2:
hyphens
, would add a "hard hyphen" (-) which would cause unintended results in your case (the email address would change).
Credits: here, here, and here
word-wrap: break-word;
. I want to "reset" the "preferred breaking points" such as "-, ?, !, &, ..." to wrap the text ONLY when it reaches the end of an box! – Morly