CSS 遇到奇怪的问题

发布于 2025-01-06 19:11:54 字数 499 浏览 2 评论 0原文

这是 CSS

#content {
    margin-left:190px;
    margin-right: 10px;
    overflow: auto;
}

Firefox & Opera 结果

在此处输入图像描述

Chrome 结果

在此处输入图像描述

尝试手动将 #content 的宽度参数设置为 90%。它“解决”了问题。

谁能解释为什么会出现这个问题以及如何解决它?

注意:左侧栏的 CSS 如下

#left {
    float:left;
    width:180px;
}

Here is CSS

#content {
    margin-left:190px;
    margin-right: 10px;
    overflow: auto;
}

Firefox & Opera result

enter image description here

Chrome Result

enter image description here

Tried to manually set #content's width param to 90%. It 'fixed' issue.

Can anyone explain why this problem occurs and how can I fix it?

Note: Css for left side bar is following

#left {
    float:left;
    width:180px;
}

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

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

发布评论

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

评论(2

孤星 2025-01-13 19:11:54

我们对您的代码结构一无所知,请制作一个[fiddle] http://jsfiddle.net具有最少的测试用例。

检查您的表格是否继承了任何浮动或宽度。

We don't have any idea about the code structure you have, Please make a [fiddle] http://jsfiddle.net with minimum test case.

Check if your table inherit any float or width.

陌伤浅笑 2025-01-13 19:11:54

如果没有看到代码,很难说,但如果这些是您正在使用的表,那么您可能会找到答案(以及创建一个最小的测试用例)的地方就是研究不同的浏览器如何以不同的方式处理表/表 css。从历史上看,样式表在浏览器之间总是有点不一致。

Hard to say without seeing code, but if those are tables you are using, one place you might possibly find answers (along with creating a minimal test case) would be looking into how different browsers handle tables/table css differently. Historically, styling tables has always been a little bit inconsistent between browsers.

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