你能看到这个Html/Css代码中的错误吗?
在这里我得到了关于:你能看到这个Html/Css代码中的错误吗?,html,css,Html,Css,在这里我得到了关于: <div id="about" onMouseOver="document.getElementById('screen').style.top=60" onMouseOut="document.getElementById('screen').style.top=0"></div> 和它的风格: #screen { height:25px; width:500px; positi
<div id="about" onMouseOver="document.getElementById('screen').style.top=60" onMouseOut="document.getElementById('screen').style.top=0"></div>
和它的风格:
#screen
{
height:25px;
width:500px;
position:absolute;
top:0;left:0;right:0;bottom:0;
margin:auto;
border-style:solid;
border-radius:10px;
text-align:center;
font-style:italic;
opacity:0;
background-image:url("http://www.psdgraphics.com/file/light-wooden-background.jpg");
transition:opacity 1s, top 0.4s;
}
谢谢。您正在设置一个数字的顶部。0以外的CSS长度必须有单位
.style.top = '60px'
在“怪癖”模式下,浏览器将忽略CSS规范中的要求,即忽略具有无效属性的规则,并将假定为像素,这可能是它第一次工作的原因。您需要指定我假定的像素单位为60px
.style.top = '60px'