CSS、HTMl实现div的高度填满剩余空间

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding:0;
        }
        .content{
            position: fixed;
            top: 50px;
            bottom: 0;
            width: 100%;
        }
    </style>
</head>
<body>
<div class="top" style="background:red; height:50px; width:100%" ></div>
<div class="content" style="background:yellow;">

</div>
</body>
</html>
实现效果

CSS、HTMl使用position: fixed;实现div的高度填满剩余空间

相关文章:

  • 2021-05-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2021-05-09
  • 2022-12-23
猜你喜欢
  • 2022-02-13
  • 2022-12-23
  • 2022-01-09
  • 2021-12-20
  • 2021-07-02
相关资源
相似解决方案