我试图使用JavaScript设置div的内联样式属性。这似乎可以将值获取到警报窗口:
<!-- /returns 890px for me -->
<script>
alert(screen.height - 10 +"px");
</script>
然而,这并没有为使用的ID设置样式的div设置样式:
<script>
document.getElementById("page-wrapper").style.min-height = screen.height - 10 +"px";
</script>
这也不行:
<script>
document.getElementById("page-wrapper").style.min-height = screen.height - 10 +"px";
</script>
任何帮助都会受到赞赏。