【问题标题】:HTML - Website looks correct in IE but bugs in Chrome?HTML - 网站在 IE 中看起来正确,但在 Chrome 中出现错误?
【发布时间】:2023-03-14 04:38:02
【问题描述】:

您可以找到网站here。

在 Chrome 上: 当您将鼠标悬停在图标上时,图标会随机跳跃一些像素, 语言栏太低了...

在 IE 上: 外观和工作正常。

这里只是最重要的 CSS

CSS:

#main
{
    position: relative;
    overflow: hidden;
}

#varjo {
box-shadow: 5px 5px 10px gray;
}

.panel
{
    position: relative;
}

/* Me */

    #me
    {
    }

        #me .pic
        {
            position: relative;
            display: block;
            border-left: 1px #E1E1E1 solid;
        }

            /*
                The pseudo element below applies a noise pattern to the "me" image. It's
                meant to help mask blurriness, but you can remove it if you don't like it.
            */



            #me .pic:before
            {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                background: url('images/overlay.png');
                width: 100%;
                opacity: 0.5;
                height: 100%;
                z-index: 1;
            }

    #lang
{
background: black;
opacity: 0.7;
width: 95%;
font-family: Poiret One;
transition: 0.5s opacity;
cursor: default;
position: fixed:
}

::selection {
color: green;
}

#lang:hover{
opacity: 1;
}

    #lang a
    {
        position: relative;
        display: inline-block;
        color: #fff;
        width: 1em;
        width: 10%;
        height: 1em;
        line-height: 0.9em;
        margin-right: 150px;
        transition: 0.2s color;
        white-space:nowrap;
    }

    #lang a:hover {
    color: lightgreen;
    }

        #lang a.icon:before
        {
            padding-right: 0;
        }
#nav
{
margin-top: 20px;
}

    #nav a
    {
        position: relative;
        display: inline-block;
        color: #fff;
        width: 1em;
        height: 1em;
        line-height: 0.9em;
    }

        #nav a.icon:before
        {
            padding-right: 0;
        }

    .fa
{
    text-decoration: none;
    transition: all 0.5s;
}

    .fa.solo
    {
    }

        .fa.solo span
        {
            display: none;
        }

    .fa:before
    {
        display:inline-block;
        font-family: FontAwesome;
        font-size: 1.25em;
        text-decoration: none;
        font-style: normal;
        font-weight: normal;
        line-height: 1;
        -webkit-font-smoothing:antialiased;
        -moz-osx-font-smoothing:grayscale;
    }

您可以在源代码中看到 HTML :)

铬:

IE:

我想我使用的是最新版本的 IE 和 Chrome。 请帮忙,谢谢:)

【问题讨论】:

    标签: html css google-chrome css-transitions


    【解决方案1】:

    似乎您的内容的垂直对齐导致...

    1920 X 1080 屏幕 - 铬

    1280 X 800 屏幕 - 铬

    正如您所看到的,根据屏幕的大小,间距会发生变化 - (看看您的滚动条)

    您还可以在 #nav 元素中添加一些 margin-top:。 比如:

    #nav {
       margin-top: 30px;
    }
    

    您网站上的其他重要更改是您在#nav .fa-film span 中设置了opacity: 0。 Opacity 0 允许在您悬停时显示(我猜您只需要在用户悬停图标时显示该工具提示)。更有用的设置跨越为display: none,然后将您的#nav a:hover span 更改为

    #nav a:hover span {
      display: inherit;
    }
    

    【讨论】:

    • 在任何地方都看不到 valign。你的意思是标签还是......我还能做些什么来解决这个问题?图标是怎么回事?
    • 修复了#lang,但图标仍然跳像素:s
    • 什么意思,还在跳像素?
    • 当我将鼠标悬停在图标上时,它们实际上向左或向右移动了几个像素(它们自己和其他一些图标 + 加上内容中的一些字母)。抱歉回复晚了。
    【解决方案2】:

    将body {margin:0px; padding:0px;} 添加到您的 CSS

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-03-26
      • 1970-01-01
      • 2017-06-08
      • 1970-01-01
      相关资源
      最近更新 更多