position_fixed固定在某一个页面上

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .pg_head{
            height: 60px;
            background-color: black;
            color: white;
            position: fixed;
            /*position头部固定*/
            top :0;
            left:0;
            right:0;

        }
        .pg_body{
             background-color:#dddddd;
             height: 5000px;
            margin-top: 20px;
        }
    </style>
</head>
<body>
<!--position fixed-->
<div class="pg_head"> 头部</div>
<div class="pg_body">内容</div>
</body>
</html>
position_fixed 固定在某一个页面上

相关文章:

  • 2021-06-11
  • 2022-02-11
  • 2021-06-24
  • 2021-08-28
  • 2022-12-23
  • 2021-10-30
猜你喜欢
  • 2021-10-31
  • 2021-08-03
  • 2021-07-07
  • 2022-12-23
  • 2021-08-25
  • 2021-07-13
相关资源
相似解决方案