【发布时间】:2014-12-21 15:46:03
【问题描述】:
所以我在最新版本的 chrome 上试验了内部样式表,似乎有一个错误会破坏代码。
由于某种原因,我无法在 background-color:rgb(51,51,51) 之前添加任何 cmets 而不会导致代码失败。
这是我的代码(背景颜色不变):
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<style>
body {
width:100%; <!--browser screen must be fixed width-->
height:100%; <!--and height-->
margin:0px; <!--removes uneven margin added to row's margins-->
background-color:rgb(51,51,51); <!--note that height and width must be specified to work-->
}
</style>
</head>
<body>
<h1>
Headline
</h1>
</body>
</html>
这是我的其他代码(这次后台工作):
<html lang="en">
<head>
<meta charset="utf-8">
<style>
body {
background-color:rgb(51,51,51); <!--note that height and width must be specified to work-->
width:100%; <!--browser screen must be fixed width-->
height:100%; <!--and height-->
margin:0px; <!--removes uneven margin added to row's margins-->
}
</style>
</head>
<body>
<h1>
Headline
</h1>
</body>
</html>
请注意 cmets 可能没有意义(我删除了额外的代码但保留了 cmets)。那么究竟发生了什么?我做错了什么?
【问题讨论】: