直播程序源碼常見的網頁佈局解決方案

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
    * {
      padding: 0;
      margin: 0;
    }
    body{
        height: 100%;
    }
    #app {
        height: 100%;
    }
    .header {
        height: 60px;
        background-color: #2b83f9;
    }
    .sidebar {
	   	  // position: fixed;
		  // width: 200px;
		  // background-color: #ccc;
		  // top: 60px;
		  // left: 0;
		  // bottom: 0;
		  // overflow-y: auto;
        position: absolute;
        width: 200px;
        background-color: #ccc;
        top: 60px;
        bottom: 0;
        overflow-y: auto;
    }
    .main {
        margin-left: 200px;
        background-color: #888;
        height: calc(100vh - 60px);
        overflow: auto;
    }
  </style>
</head>
<body>
  <div id="app">
    <div class="header">Header</div>
    <div class="sidebar">
        Sidebar
        <p>1111</p>
        <p>1111</p>
        <p>1111</p>
        <p>1111</p>
        <p>1111</p>
        <p>1111</p>
        <p>1111</p>
        <p>1111</p>
        <p>1111</p>
        <p>1111</p>
        <p>1111</p>
        <p>1111</p>
    </div>
    <div class="main">
        App Main
    </div>
  </div>
</body>
</html>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章