此代码应设置元素高度;但是没有添加任何样式。我错过了一些明显的东西吗?
function setGround() {
document.getElementById('content').style.height = '40px';
}
document.onload = setGround;
HTML 非常基础:
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Template</title>
<link rel="stylesheet" type="text/css" href="css/default.css"/>
<link rel="stylesheet" type="text/css" href="css/orange.css"/>
<script type="text/javascript" src="javascript/detect-css.js"></script>
</head>
<body>
<header>
<div id="logo"></div>
</header>
<section id="sidebar"><p>sf </p>
</section>
<section id="content"><p>sf </p>
</section>
</body>
</html>
谢谢您的帮助!