为什么下边框在文本下右移?

时间:2019-06-21 18:41:29

标签: css hover

如果您查看以下站点:staging.cancerwellness.com,并突出显示顶部菜单,您会看到该项目变为红色,但下划线向右移动。

这是CSS代码:

    private void SaveImage(Image image, string fileToSave, ImageFormat imageFormat, TimeSpan interval)
    {
        try
        {
            image.Save(fileToSave, imageFormat);
        }
        catch (Exception ex)
        {
            Trace.TraceError("View Capture Service exception on first attempt to save image: " + ex.Message);
            Thread.Sleep(Convert.ToInt32(interval.TotalMilliseconds / 2));
            image.Save(fileToSave, imageFormat);
        }
    }

FWIW,我确实尝试过display:inline-box,但是没有用。

什么会导致边界向右移动?

谢谢你, 凯文·戴维斯

1 个答案:

答案 0 :(得分:0)

在firefox中,鼠标悬停事件在每个链接下方显示一个下划线。有时,当Web开发人员更喜欢使用特定的浏览器时,他们并不期望其他浏览器会发生什么。我在工具提示中遇到了这种情况,其行为非常相似。

这是我认为可能会帮助您解决的另一个问题,但我认为这不是一个困扰它的CSS规则。

Click event in chrome vs firefox gives different targets?