任何精通 CSS 的人都可以帮我解决 WebSVN 设置的问题吗?

发布于 2024-08-03 13:16:15 字数 1066 浏览 5 评论 0原文

对于 CSS 来说,我完全是个新手,所以我几乎放弃了自己解决这里的问题。

我遇到的问题是我的 WebSVN 安装有一个与查看差异文件相关的奇怪问题。有一些 CSS 会突出显示当前行,但是当我在屏幕上上下移动鼠标时,这些行会升高或降低 1-2 个像素,具体取决于我移动鼠标的方向。

在这里,试图解释它有点困难,这是一个显示问题的动画 gif:

WebSVN CSS问题说明 http://www.vkarlsen.no/files/websvn_css.gif

要亲自尝试,请转到我的 WebSVN 存储库:

http://vkarlsen.serveftp.com:81/websvn/diff.php?path=/LVK_3_5/branches/controller_designer/LVK.Core/Reflection/TypeHelper.cs&rev=667&sc=1&repname=LVK

不幸的是,Google Chrome(或其他)似乎破坏了上述内容的“可点击性”链接,为了避免出现问题,我刚刚以文本形式发布了实际链接。您需要登录,但用户名和密码都是“guest”,不带引号。请注意,您可能会收到有关该站点证书的警告。这是一个私人服务器,所以我不会花钱购买真正的证书,所以忽略它。

在我使用的浏览器 Chrome 和 Internet Explorer 中,问题显而易见。

谢谢,问题已通过接受的答案解决了,但我的问题也部分是这样的:

当您在动画 gif 中看到,或者如果您尝试过,鼠标向上移动时,我知道该行的 CSS 悬停样式使该行更高。但是,一旦我将鼠标悬停在一行上,即使将鼠标光标移动到另一行,插图中的底线也不应该移动。诚然,我所在的行以及我移动到的行应该根据方向进行移动,因为一个丢失了 1-2 个像素,而另一个获得了它们,但是插图底部的文本行应该并没有真正移动,应该吗?当我将鼠标光标移动到行列表中时,并且只有当我将其移出时,它们才应该向下移动 1-2 个像素。

我只是觉得这种特殊的行为很奇怪。

I'm a total newbie when it comes to CSS so I've pretty much given up on figuring out the problem here myself.

The problem I have is that my WebSVN installation has an odd problem related to viewing diffed files. There's some CSS that highlights the current line, but when I move my mouse up and down over the screen, the lines gets to be 1-2 pixels higher, or lower, depending on the direction I move the mouse.

Here, it's a bit difficult trying to explain it, here's an animated gif that shows the problem:

WebSVN CSS Problem Illustration http://www.vkarlsen.no/files/websvn_css.gif

To try it yourself, go to my WebSVN repository here:

http://vkarlsen.serveftp.com:81/websvn/diff.php?path=/LVK_3_5/branches/controller_designer/LVK.Core/Reflection/TypeHelper.cs&rev=667&sc=1&repname=LVK

Unfortunately it seems Google Chrome (or whatnot) breaks the "clickability" of the above link, so to avoid problem I've just posted the actual link in text. You'll need to log in, but the username and password are both 'guest' without the quotes. Note that you'll probably get a warning about the certificate for the site. It's a private server so I'm not shelling out for a real certificate so just ignore that.

In Chrome, the browser I use, and Internet Explorer, the problem is visible.

Thanks, problem solved with the accepted answer, but my question was also partly this:

When you see, in the animated gif, or if you tried it, the mouse moving upwards, I understand that a CSS hover style for the line makes that line higher. However, the bottom lines in the illustration should not move once I am hovering over one line, even if I move the mouse cursor to another line. Granted, the line I was on, and the line I moved to, should shift, depending on the direction, because one lost the 1-2 pixels, and the other one gained them, but the text lines in the bottom of the illustration should not really move, should they? They should only move down 1-2 pixels when I move the mouse cursor into the list of lines to begin with, and only if I move it back out.

I just thought that particular behavior was rather odd.

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

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

发布评论

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

评论(4

败给现实 2024-08-10 13:16:15

尝试改变:

tbody tr:hover td.diff, tbody tr.diffcode:hover td pre {
  background-color:#e8e8e8;
  border:1px solid #cccccc;
}

tbody tr:hover td.diff, tbody tr.diffcode:hover td pre {
  background-color:#e8e8e8;
}

Try changing:

tbody tr:hover td.diff, tbody tr.diffcode:hover td pre {
  background-color:#e8e8e8;
  border:1px solid #cccccc;
}

into

tbody tr:hover td.diff, tbody tr.diffcode:hover td pre {
  background-color:#e8e8e8;
}
等风来 2024-08-10 13:16:15

请记住,CSS 高度和宽度不包括内边距、边框和边距。因此,如果我有一个高度为 10 像素、内边距为 3 像素、边框为 1 像素的框,则实际高度将为 18 像素:10 高度 + 6 顶部和底部总内边距 + 2 顶部和底部边框。

Remember that CSS heights and widths do no include the padding, border and margin. So, if I have a box that has a height of 10 pixels, padding of 3 pixels and border of 1 pixel, the actual height will be 18 pixels: 10 height + 6 total padding top and bottom + 2 border top and bottom.

梦回旧景 2024-08-10 13:16:15

我认为问题是你的边界没有像你希望的那样崩溃。

您有一个规则:

tbody tr:hover td.diff, tbody tr.diffcode:hover td pre {
    background-color: #E8E8E8;
    border: 1px solid #CCCCCC;
}

您期望 pre 的边框与 td.diff 的边框合并。我认为填充会导致边框在浏览器中不折叠,或者可能是 pre 不是 table 的一部分(我不能肯定地说) 。

更改选择器,使其不包含 pre

tbody tr:hover td.diff {
    background-color: #E8E8E8;
    border: 1px solid #CCCCCC;
}

这样,pre 就不会获得边框,因此不必将边框与 合并>td.diff

I think the issue is your borders aren't collapsing as you want them to.

You have a rule:

tbody tr:hover td.diff, tbody tr.diffcode:hover td pre {
    background-color: #E8E8E8;
    border: 1px solid #CCCCCC;
}

You're expecting the pre's border to merge with the td.diff's border. I think padding causes the borders not to collapse in the browsers, or it could be that pre isn't part of the table (I can't say which for sure).

Change the selector so it doesn't include the pre:

tbody tr:hover td.diff {
    background-color: #E8E8E8;
    border: 1px solid #CCCCCC;
}

This way, the pre doesn't get a border so it doesn't have to merge the border with td.diff.

云淡风轻 2024-08-10 13:16:15

该问题看起来是由将鼠标悬停在元素上时添加额外的灰色边框引起的。边框应用在元素占据的主要区域的外部

解决此问题的简单方法是将非悬停状态设置为具有与背景颜色相同的边框,然后仅在悬停时更改边框颜色属性。

The problem looks likes it's caused by the addition of the extra grey border when hovering over the element. Borders are applied outside the main area taken up by the element.

The simple fix for this is to set the non-hovered state to have a border of the same colour as the background, then only change the border-color property on hover.

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