zoukankan      html  css  js  c++  java
  • 用1个 2个3个 5个div实现 十字架

    <!doctype html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <title>Document</title>
      <style>
      .que{
        position: relative;
        margin: 20px;
      }
      .que .h, .que .v, .que .s{
        background: pink;
      }
      .que1{
       height: 200px;
      }
      .que1 .h{
        position: absolute;
        top: 50px;
        width: 150px;
        height: 50px;
      }
      .que1 .v{
        position: absolute;
        width: 50px;
        height: 150px;
        left: 50px;
      }
      .que2{
    
      }
      .que2 .s, .que2 .h{
        position: relative;
        height: 50px;
      }
      .que2 .h{
        width: 150px
      }
      .que2 .s{
        width: 50px;
        margin-left: 50px;
      }
      .que3 .s{
        width: 50px;
        height: 50px;
      }
      .que3 .s:nth-child(1),.que3 .s:nth-child(5){
        margin: 0 50px;
      }
      .que3 .s:nth-child(2),.que3 .s:nth-child(3),.que3 .s:nth-child(4){
        display: inline-block;
        margin-right: -4px;
        margin-bottom: -4px;
      }
      .que4{
        position: relative;
      }
      .que4 .h{
        position: absolute;
        top: 50px;
        width: 150px;
        height: 50px;
      }
      .que4 .h:after{
        content: ' ';
        display:block;
        position: absolute;
        width: 50px;
        height: 150px;
        left: 50px;
        top:-50px;
        background-color: pink;
      }
      </style>
    </head>
    <body>
      <div class="que que1">
        <div class="h"></div>
        <div class="v"></div>
      </div>
      <div class="que que2">
        <div class="s s1"></div>
        <div class="h"></div>
        <div class="s s2"></div>
      </div>
      <div class="que que3">
        <div class="s"></div>
        <div class="s"></div>
        <div class="s"></div>
        <div class="s"></div>
        <div class="s"></div>
      </div>
      <div class="que que4">
        <div class="h"></div>
      </div>
    <script>
    
    
    </script>
    </body>
    </html>
  • 相关阅读:
    Luogu P1247 取火柴游戏
    Luogu P2148 [SDOI2009]E&D
    Luogu P3305 [SDOI2013]费用流 二分 网络流
    NTT学习笔记
    Luogu P4015 运输问题
    Lucas定理学习笔记(没有ex_lucas)
    Luogu P2613 【模板】有理数取余
    欧拉定理与扩展欧拉定理学习笔记
    BSGS与exBSGS学习笔记
    Luogu P3868 [TJOI2009]猜数字
  • 原文地址:https://www.cnblogs.com/cart55free99/p/4189979.html
Copyright © 2011-2022 走看看