如何将长网址分成两行

发布于 2024-11-13 23:54:34 字数 246 浏览 8 评论 0原文

我有一个非常窄的列和一个三字 URL,该 URL 比列的原始宽度更宽。

我可以强制这三个单词分布在两行或三行上并保持 URL 链接完整吗?

我正在使用 css 来设置自定义 drupal 主题的样式,并且此 url 的长度/名称是通过 QuickTabs 模块转换为选项卡的 Drupal 节点名称,因此我最好通过 css 来管理它。我感觉这是一个非常简单的解决方案,但我通过谷歌进行了搜索,但找不到任何适合我的东西。

提前致谢。

I have a very narrow column and a three-word URL that is pushing wider that the column's original width.

can i force the three words to spread over two or three lines and keep the URL link intact?

I am using css to style a custom drupal theme and the length/name of this url is a Drupal node name turned into a tab via the QuickTabs module, so I need to manage it via css, preferrably. I have the feeling this is a very easy fix, but I have searched thru Google and I cannot find anything that works for me.

Thanx in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

抱着落日 2024-11-20 23:54:34

尝试使用:

word-wrap: break-word;

但我认为并非所有浏览器都支持它。

有关示例,请参阅 http://jsfiddle.net/jrRqb/

Try using:

word-wrap: break-word;

I don't think its supported in all browsers though.

See http://jsfiddle.net/jrRqb/ for an example

画骨成沙 2024-11-20 23:54:34

我知道这不是最纯粹的答案,但有时链接文本中的
是最简单的事情。

<p><a href="http://www.vatican.va/holy_father/benedict_xvi/travels/2011/index_croazia_en.htm">http://www.vatican.va/holy_father/benedict_xvi/<br />travels/2011/index_croazia_en.htm</a></p>

http://jsfiddle.net/jasongennaro/8xmU5/

I know it is not the purest answer, but sometimes a <br /> in the link text is the easiest thing.

<p><a href="http://www.vatican.va/holy_father/benedict_xvi/travels/2011/index_croazia_en.htm">http://www.vatican.va/holy_father/benedict_xvi/<br />travels/2011/index_croazia_en.htm</a></p>

http://jsfiddle.net/jasongennaro/8xmU5/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文