HTML在页面滚动时顶部不动。

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>无标题页</title>
<style type="text/css">
body, html
{
width
:100%;
height
:100%;
}

*
{
margin
:0px; padding:0px;
}

body
{
font-size
:14px;
line-height
:1.5;
font-family
:Consolas Tahoma Verdana;
}
</style>
</head>
<body>
<div id="divTop" style="background-color:#eee; border-bottom:solid 1px gray; line-height:30px; position:fixed; top:0px; width:100%; z-index:1;">
顶部内容
</div>
<div style="height:2000px; position:relative; top:30px; _top:0px;">sssssssssss</div>
</body>
</html>

下载:https://files.cnblogs.com/zjfree/htmlTopMsg.rar

相关文章:

  • 2022-02-21
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
  • 2021-09-29
  • 2021-09-29
  • 2021-12-20
猜你喜欢
  • 2022-01-08
  • 2021-10-28
  • 2021-12-05
  • 2021-12-15
  • 2022-03-08
  • 2022-02-08
  • 2021-12-05
相关资源
相似解决方案