5
这是代码:该代码在html代码验证器中仍然有一个警告。我还需要插入什么?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
看来我这里有一个问题:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type='text/javascript'>
function run(){
var div = document.createElement('div')
div.style.position = 'absolute'
div.style.left = '0px'
div.style.top = '0px'
div.onmouseover=function(){
alert('mo')
this.style.opacity = 0
}
div.style.width = '30px'
div.style.height = '30px';
div.style.backgroundColor = '#000'
document.body.appendChild(div)
}
onload = run
</script>
<title></title>
</head>
<body>
</body>
</html>
什么我仍然需要插入或编辑,所以我的代码变成代码验证完全OK? 谢谢:)
什么是你得到的警告?警告通常是“你不必修复它,但你应该知道它在那里”有点类似。 –
'body'元素不能为空。 –
通过复制粘贴在http://validator.w3.org/check中进行了测试。警告只存在,因为它的复制粘贴不能执行utf8检查,不验证真实站点。 –