带有长网址的CSS溢出 [英] CSS overflow with long URL

查看:86
本文介绍了带有长网址的CSS溢出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,所以我将Google广告放在一个160x600的容器中.新广告会在刷新时随机显示.当广告弹出的URL长且不包含任何破折号或任何要中断的字符时,就会从容器div中溢出.现在我有溢出:隐藏,所以隐藏了160像素之后的所有内容.问题是,如果URL较长,则其中的一些会被隐藏(这很好),但广告上方的文本也会被隐藏而不是被破坏,因为它会沿URL的方向水平流出.

Ok, so I have google ads inside a 160x600 container. New ads are shown randomly on refresh. When an ad pops up with a long URL that doesn't contain any dashes or any characters for it to break at, it overflows out of the container div. Right now I have overflow:hidden so anything after 160 pixels in hidden. The problem is that if there's a long URL some of it gets hidden (which is fine) but the text above the ad also gets hidden instead of breaking because it flows out horizontally as far as the url goes.

即使无法使下面的URL自动换行,如何使文本一致并以160像素换行?

How do I make the text conform and wrap at 160 pixels even though I can't make the URL below it wrap?

谢谢!

推荐答案

对于浏览器哪一个 支持 it

For browsers which support it, word-wrap: break-word;.

这篇关于带有长网址的CSS溢出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆