开发者

URL Word-wrap Issue

开发者 https://www.devze.com 2023-02-25 00:42 出处:网络
Word-wrap issues seem to have been asked and answered loads of times but I can\'t find exactly what I want.

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>
0

精彩评论

暂无评论...
验证码 换一张
取 消