Word-wrap issues seem to have been asked and answered loads of times but I can't find exactly what I want.
Basically, I'm using
word-wrap: break-word;
to brea开发者_Go百科k a URL written into a DIV so it doesn't overflow. Works fine except visually it's very poor with certain URLs. For example,
www.stackoverflow.com/questions/anotherbit/andabitmore
it'll work fine and wrap at the end of a line. However, with,
www.stackoverflow.com?fishingandthesomemore=someothertext
it will break at the ? rather than the end of the line.
Anyone got any clever ideas ?
If you are using a php doc you can use the php wordwrap native function like so...
<div>
<a href="google.com"><?php echo wordwrap('www.stackoverflow.com?fishingandthesomemore=someothertext', 30, "<br />", true); ?></a>
</div>
精彩评论