html代码:

<header class="header"></header>
<aside class="aside"></aside>
<main class="main"></main>

css代码:

.header{
  width: 100%;
  height: 60px;
  background-color: #B3C0D1;
}

.aside{
  position: absolute;
  top: 60px;
  left: 0;
  bottom: 0;
  width: 300px;
  background-color: #D3DCE6;
}

.main{
  position: absolute;
  top: 60px;
  right: 0;
  left: 300px;
  bottom: 0;
  background-color: #E9EEF3;
}

效果展示:
用最简单的代码同时实现自适应宽度和高度的布局效果

相关文章:

  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-06
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
  • 2021-09-28
  • 2022-02-18
  • 2021-05-18
相关资源
相似解决方案