<html>究竟是什么?

omg*_*omg 4 html

滚动条属于<html><body>

我一直在为每个html文件写作,但不确切知道它是什么.

Ion*_*tan 15

鉴于以下标记和样式:

<!DOCTYPE html>

<html>
<head>
<title></title>
<style type="text/css">
html {
 background: green;
 overflow:scroll;
}
body {
 background: red;
 overflow:scroll;
}
</style>
</head>
<body>

</body>
</html>
Run Code Online (Sandbox Code Playgroud)

我们得到以下视觉效果:

Firefox 3.5

Firefox 3.5 http://img98.imageshack.us/img98/3448/ff35.png

Internet Explorer 6

Internet Explorer 6 http://img98.imageshack.us/img98/870/ie6.png

歌剧10

Opera 10 http://img22.imageshack.us/img22/1395/o10.png

谷歌Chrome 3

谷歌浏览器3 http://img193.imageshack.us/img193/4300/82451373.png

所以,我们可以设计HTML元素的样式.实际上,有些人将其与BODY标签结合使用以获得复杂的背景.

  • 随意添加其他IE版本的截图. (2认同)

mau*_*ris 10

<html>没有视觉.它只是定义文档是一个html文档,它包含headbody.

这是body一个具有view.

滚动条属于window如果你谈论DOM.
但是在CSS中,您可以设置滚动条样式<body>

如果您在Firefox上使用Firebug并使用元素检查器(您可以移动鼠标并指向HTML文档的元素,并指向空白区域,那里没有元素,它指向<body>.