zoukankan      html  css  js  c++  java
  • JS菱形镂空

    <!DOCTYPE html>
    <html>
     
    <head>
    <meta charset="UTF-8">
    <title></title>
    <style type="text/css">
    .container {
    float: left;
    font-size: 32px;
    }
     
    .container span {
    display: inline-block;
    width: 32px;
    }
    </style>
    </head>
     
    <body>
     
    <!--<div class="container">
    <script type="text/javascript">
    for(var i=0;i<4;i++){
    //输出空格
    for(var j=0;j<4-i-1;j++){
    document.write("<span></span>");
    }
    //输出*
    for(var j=0;j<2*i+1;j++){
    document.write("<span>*</span>");
    }
    //换行
    document.write("<br/>");
    }
    for(var i=0;i<3;i++){
    //输出空格
    for(var j=0;j<i+1;j++){
    document.write("<span></span>");
    }
    //输出*
    for(var j=0;j<5-2*i;j++){
    document.write("<span>*</span>");
    }
    //换行
    document.write("<br/>");
    }
    </script>
    </div>-->
     
    <script type="text/javascript">
    for(var x = 0; x < 30; x++) {
    document.write("<div class='container'>");
    for(var i = -3; i <= 3; i++) {
    var absi = Math.abs(i);
    for(var j = 0; j < absi; j++) {
    document.write("<span></span>");
    }
    for(var j = 0; j < 7 - 2 * absi; j++) {
    if(j==0||j==7-2*absi-1)
    document.write("<span>*</span>");
    else
    document.write("<span></span>");
    }
    document.write("<br/>");
    }
    document.write("</div>")
    }
    </script>
    </body>
     
    </html>
  • 相关阅读:
    golang-grpc-Unimplemented-desc
    redis使用get key中文变成十六进制编码
    golang-generate-1pixel-image
    telnet-redis-quit
    redis hset hmset过期时间
    cookie mapping 原理理解
    excel 表格粘贴到word 显示不完整
    golang-test-tool-gotests
    go build Multiple main.go file
    golang-build-error
  • 原文地址:https://www.cnblogs.com/yan-linxi/p/8056983.html
Copyright © 2011-2022 走看看