Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

实现圣杯布局 #406

Open
Pcjmy opened this issue Jan 19, 2023 · 2 comments
Open

实现圣杯布局 #406

Pcjmy opened this issue Jan 19, 2023 · 2 comments

Comments

@Pcjmy
Copy link
Contributor

Pcjmy commented Jan 19, 2023

No description provided.

@bearki99
Copy link

bearki99 commented Feb 8, 2023

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .content {
        overflow: hidden;
        padding: 0 220px 0 200px;
      }
      .middle,
      .left,
      .right {
        float: left;
        position: relative;
      }
      .middle {
        width: 100%;
        height: 200px;
        background-color: aqua;
      }
      .left {
        left: -200px;
        width: 200px;
        height: 200px;
        margin-left: -100%;
        background-color: blue;
      }
      .right {
        margin-left: -220px;
        width: 220px;
        height: 200px;
        right: -220px;
        background-color: brown;
      }
    </style>
  </head>
  <body>
    <div class="content">
      <div class="middle"></div>
      <div class="left"></div>
      <div class="right"></div>
    </div>
  </body>
</html>

@veneno-o
Copy link
Contributor

  • 用flex
<style>
        body{
            margin: 0;
        }
        div{
            height: 100px;
        }
        .container{
            width: 100vw;
            display:flex;
        }
        .main{
            background: red;
            flex-grow: 1;
            order: 2;
        }
        .left{
            background: #000;
            width: 200px;
            order: 1;
        }
        .right{
            background: blue;
            width: 200px;
            order: 3;
        }
    </style>
<div class="container">
        <div class="main"></div>
        <div class="left"></div>
        <div class="right"></div>
    </div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants