CSS 溢出和自动换行行为对我没有任何帮助

发布于 2024-08-22 07:35:02 字数 864 浏览 7 评论 0原文

您可以查看文件名字段的外观 http://www.plifk.com/henvic/114< /a> 以及它如何打破 http://www.plifk.com/henvic/159< 的布局/a>

如果我使用 108574main-neutron-star-and-a-very-bad-overfow-will-happen-here-so-sad.mpg 我不会溢出,但在第一行“108574main-neutron- star-and-a-very-”,第二行是“bad-overfow-happens.mpg”。我该怎么做才能避免溢出?

请知道,我不想使用怪癖(比如 PHP 的自动换行,如果可能的话也不想使用 JavaScript),并且我已经在 CSS 中尝试了一些自动换行的方法等,但没有任何结果。

我也尝试过 word-break: break-all (仅在 Firefox 上测试),但它也不起作用。

连溢出:隐藏;不起作用...我对网页设计不太熟悉(事实上,我尝试按照标准做所有事情等),我现在完全迷失了。

未压缩的CSS文件可以在 http://pastebin.ca/1802451 看到

现在...我真的明白了一旦自动换行适用于文本而不是字符,这是预期的。但是,嘿,即使打破了一切,它也没有任何作用。怎么可以?

预先非常感谢您。

You can see how the filename field should look at http://www.plifk.com/henvic/114 and how it breaks the layout at http://www.plifk.com/henvic/159

If I used 108574main-neutron-star-and-a-very-bad-overfow-will-happen-here-so-sad.mpg I would not get an overflow, but in the first line "108574main-neutron-star-and-a-very-" and in the second line a "bad-overfow-happens.mpg". What can I do to avoid getting an overflow?

Please know that I don't want to use quirks (like PHP's wordwrap, neither JavaScript if possible) and I've tried some ways in CSS with word-wrap, etc, but nothing worked out.

I've also tried word-break: break-all (tested on Firefox only) but it didn't work also.

Even the overflow: hidden; is not working... I'm not very familiar with web designing (indeed I try to do everything by the standards, etc) and I'm completely lost right now.

The uncompressed CSS file can be seen at http://pastebin.ca/1802451

Now... I really understand that this is expected once the word-wrap is supposed for text, not characters. But hey, even with break-all it doesn't do anything. How can?

Thank you very much in advance.

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

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

发布评论

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

评论(1

病毒体 2024-08-29 07:35:03

您可以设置#metasidebar {overflow:hidden;}。那会起作用的。不确定你喜欢它如何剪切文本,但至少它不会溢出。

您还可以尝试剪切文件名或在 php.ini 中插入断点。像这样的东西:

if(strlen($filename) > self::MAX_FILENAME_LENGTH) {
   // Make some smart splitting, or just insert a dash at a given length,
   // since rendering engines can line-break on dash
}

You can set #metasidebar {overflow: hidden;}. That'll work. Not sure you like how it cuts the text, but at least it doesn't overflow.

You could also try to cut the filename or insert breakpoints in php. Something like:

if(strlen($filename) > self::MAX_FILENAME_LENGTH) {
   // Make some smart splitting, or just insert a dash at a given length,
   // since rendering engines can line-break on dash
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文