100% 宽度在 webkit 浏览器中始终至少 1 像素宽

发布于 2024-11-01 09:49:54 字数 461 浏览 0 评论 0原文

我有一个带有面板的 GWT 应用程序,其中包含未定义数量的宽度不同的小部件以及底部的通用描述和工具栏。面板始终至少与工具栏一样宽,并在小部件更宽的情况下延伸。

当工具栏较宽时,我尝试在小部件的右侧添加尾随边框,但我似乎无法正确操作。在 firefox 和 explorer 中它工作得很好 - 如果有足够的小部件,边框会缩小到 0px。然而,在 chrome 和 safari 中,带边框的 div 始终至少为 1px 宽,这打破了设计的其余部分。

谁能告诉我我做错了什么?我在此处稍微简化了代码。红色部分是固定工具栏,黑色部分是小部件(通过鼠标悬停模拟不同宽度),有问题的边框是橙色(ID为“border”)。我意识到代码可以更好,但这部分是由于 GWT 对基于表格的面板的痴迷。

希望这个问题有意义。

谢谢。

I have a GWT app with a panel which contains contains an undefined amount of widgets with varying widths and a common description and toolbar in the bottom. The panel is always at least as wide as the toolbar and extends in case the widgets are wider.

I tried adding a trailing border to the right of the widgets when the toolbar is wider but I can't seem to get it right. In firefox and explorer it works fine - if there's enough widgets, the border shrinks to 0px. In chrome and safari however, the div with the border is always at least 1px wide, which breaks the rest of the design.

Can anyone tell me what I'm doing wrong? I simplified the code somewhat here. The red part is the fixed toolbar, the black part are the widgets (varying width simulated with mouse-over), and the problematic border is orange (with ID "border"). I realize the code could be nicer, but it's partly due to GWT's obsession with table based panels.

Hopefully this question makes sense.

Thanks.

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

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

发布评论

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

评论(2

薄荷梦 2024-11-08 09:49:54

如果工具栏中有任何小部件,将边框设置为 0px 怎么样?

How about setting the border to 0px if there are any widgets in the toolbar?

﹎☆浅夏丿初晴 2024-11-08 09:49:54

你有没有尝试过:显示:无;我相信 webkit 默认将显示设置为表格单元格。

have you tried: display:none; I believe webkit sets the display to table-cell by default.

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