Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html IE导致css宽度动画反转_Html_Css_Css Animations - Fatal编程技术网

Html IE导致css宽度动画反转

Html IE导致css宽度动画反转,html,css,css-animations,Html,Css,Css Animations,相关部分: #inline-navigation ul { display: table; text-transform: uppercase; text-align: center; list-style-type: none; margin: 0 auto; padding: 24px 0px; } #inline-navigation ul li { display: table-cell; } #inline-navigatio

相关部分:

#inline-navigation ul {
    display: table;
    text-transform: uppercase;
    text-align: center;
    list-style-type: none;
    margin: 0 auto;
    padding: 24px 0px;
}

#inline-navigation ul li {
    display: table-cell;
}

#inline-navigation ul li a {
    text-decoration: none;
    color: #777;
    padding: 0 4px;
    font-family: Monaco, Consolas, "Lucida Console", monospace;
    font-size: 15px;
    transition: 0.3s;
    height: 20px;
    line-height: 20px;
    margin: 0 4px;
    position: relative;
}

#inline-navigation ul li a:after,
#inline-navigation ul li a:before {
    content: '';
    border-bottom: 1px solid #ff6600;
    box-shadow: 0 2px 2px -2px #777;
    display: block;
    position: absolute;
    transition: 0.1s;
    width: 0;
}

#inline-navigation ul li:nth-child(1) a:before,
#inline-navigation ul li:nth-child(2) a:before {
    right: 0;
    top: -4px;
}

#inline-navigation ul li:nth-child(1) a:after,
#inline-navigation ul li:nth-child(2) a:after {
    bottom: -4px;
    left: 0;
}

#inline-navigation ul li:nth-child(3) a:before,
#inline-navigation ul li:nth-child(4) a:before {
    left: 0;
    top: -4px;
}

#inline-navigation ul li:nth-child(3) a:after,
#inline-navigation ul li:nth-child(4) a:after {
    bottom: -4px;
    right: 0;
}

#inline-navigation ul li a:hover {
    color: #ff6600;
}

#inline-navigation ul li a:hover:before,
#inline-navigation ul li a:hover:after {
    width: 75%;
}
在InternetExplorer11中,动画会产生一个非常奇怪的边框闪烁,其中
:after
:before
元素上的边框似乎脱离父元素(?)。我认为这是因为与其他浏览器相比,动画的播放方式是相反的

小提琴

在Chrome和Firefox上运行良好。想法?

元素在默认情况下是内联的,并且您的样式会在
:before
:after
样式中阻止它们。看起来IE在默认内联和块样式之间切换锚点时遇到了问题。不确定到底是什么问题,但是

如果在样式表中设置锚块,“切换”不会发生,它会解决问题,所以只需添加


a{display:block;}
到样式表的底部。请记住,更改块元素的定位可能会影响布局,因此请进行相应调整

默认情况下,
元素是内联的,并且您的样式在
:before
:after
样式中阻止它们。看起来IE在默认内联和块样式之间切换锚点时遇到了问题。当我在样式表的底部添加
a{display:block;}
时,它似乎解决了这个问题。请注意,我发表了评论,而不是回答,因为a)我真的不知道到底发生了什么,b)据我所知,制作锚块可能会破坏你的布局,这很有效!谢谢我为导航中的
a
元素制定了一个非常具体的规则,这样就不会影响页面。太棒了!很高兴我能帮上忙。可能是