Html CSS在Chrome web浏览器中不起作用
正如标题所示,我有一个网页,我在谷歌Chrome上测试了它,CSS不起作用。然后我返回并检查CSS文件是否正确链接到HTML文件,并检查了。然后我试着在Firefox浏览器中打开它,它成功了。有人能告诉我为什么它不在Chrome中工作,而在Firefox中工作吗 CSS文件:Html CSS在Chrome web浏览器中不起作用,html,css,google-chrome,Html,Css,Google Chrome,正如标题所示,我有一个网页,我在谷歌Chrome上测试了它,CSS不起作用。然后我返回并检查CSS文件是否正确链接到HTML文件,并检查了。然后我试着在Firefox浏览器中打开它,它成功了。有人能告诉我为什么它不在Chrome中工作,而在Firefox中工作吗 CSS文件: #news { margin-top: 60px; text-align: center; } #newsp { font-size: 20px; padding-top: 10px
#news {
margin-top: 60px;
text-align: center;
}
#newsp {
font-size: 20px;
padding-top: 10px;
padding-bottom: 20px;
padding-left: 10px;
position: absolute;
float: left;
padding-right: 10px;
}
#thankyou {
margin-top: 200px;
font-size: 15px;
text-align: center;
color: gray;
}
#websiteul {
list-style-type: none;
}
#websitelist {
float: right;
margin-right: 20px;
}
我无法真正看到动画,但这里有一个动画示例:
#first-child {
width: 200px;
height: 200px;
background: white;
-webkit-animation: myfirst 1s;
-moz-animation: myfirst 1s;
animation: myfirst 1s;
}
@-webkit-keyframes myfirst {
0% {background: white;}
50% {background: white;}
100% {background: red;}
}
@keyframes {
0% {background: white;}
50% {background: white;}
100% {background: red;}
}
以及HTML:
<div id="first-child"></div>
如果你想让动画在chrome中工作,你应该使用-webkit动画,如果你想让它在firefox中工作,你应该像代码中那样使用-moz动画我们需要更多细节。CSS文件中有什么?也许你正在使用一些Firefox特定的CSS规则,Chrome引擎会忽略这些规则。@doldt我在CSS文件中添加了。似乎没有什么特别的。。。当你在Chrome中打开开发者控制台,检查一个DOM元素,这个元素应该有一些CSS样式,右键单击,检查元素,你能看到CSS规则出现在右边吗?你能创建JSFIDLE,更好地理解你的代码吗?@Javy根据你的CSS,我认为margin top在Chrome中似乎不起作用。要在chrome中工作,请先使用webkit页边距,然后再使用样式。