GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — vue-DBM/docs/layout.md at master · calebman/vue-DBM

Expand file tree

/

layout.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
145 lines (120 loc) · 2.72 KB
/

layout.md

Copy path

File metadata and controls

145 lines (120 loc) · 2.72 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

系统整体布局的方式与实现

1. 系统整体布局方式

1.1 布局规划

  • 在这里将区域划分成了蓝色方框和红色方框两部分
  • 蓝色方框是一个上下高度固定中间自适应的上中下布局
  • 红色方框则是一个左边宽度固定之后使用一个小的布局隔开
  • 右边占满剩余宽度的布局。

2. 实现方法

2.1 构建上中下布局

复制以下代码至浏览器执行

<!doctype html>
<html>

<head>
  <meta charset="utf-8">
  <title>简单实现上中下布局</title>
  <style>
    html,
    body {
      *overflow: hidden;
      /*防止出现横向滚动条*/
      margin: 0 auto;
    }

    .layout-header,
    .layout-main,
    .layout-footer {
      width: 100%;
      position: absolute;
    }

    .layout-header {
      background: #495060;
      /*设置头部高度*/
      height: 64px;
      top: 0;
    }

    .layout-main {
      background: #e0eeee;
      /*需要与设置的高度一致*/
      top: 64px;
      bottom: 50px;
      /*中间高度自适应*/
      height: auto;
    }

    .layout-footer {
      background: gray;
      /*设置底部高度*/
      height: 50px;
      bottom: 0;
    }
  </style>
</head>

<body>
  <div class="layout-header"></div>
  <div class="layout-main"></div>
  <div class="layout-footer"></div>
</body>

</html>

2.2 构建左中右布局

复制以下代码至浏览器执行

<!doctype html>
<html>

<head>
  <meta charset="utf-8">
  <title>简单实现左中右布局</title>
  <style>
    html,
    body {
      margin: 0 auto;
      width: 100%;
      height: 100%;
    }

    .container {
      width: 100%;
      height: 100%;
      position: relative;
      display: flex;
      /*设为伸缩容器*/
    }

    .container .container-left {
      width: 240px;
      /*左侧菜单栏的宽度*/
      height: 100%;
      background: #8db6cd;
    }

    .container .container-center {
      width: 16px;
      /*设置中间隔开层的宽度*/
      height: 100%;
    }

    .container .container-right {
      flex: 1;
      /*占满剩余宽度*/
      width: 100%;
      height: 100%;
      position: relative;
      background: #48d1cc;
    }
  </style>
</head>

<body>
  <div class="container">
    <div class="container-left"></div>
    <div class="container-center"></div>
    <div class="container-right"></div>
  </div>
</body>

</html>

2.3 合并两个布局

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.