Responsive grid of squares within a responsive grid of squares

后端 未结 4 1162
失恋的感觉
失恋的感觉 2021-01-26 01:16

I am trying to make a grid of responsive squares, with each square in the grid containing another grid of responsive squares. Think of a sudoku board, which has 9 squares, each

4条回答
  •  忘掉有多难
    2021-01-26 01:49

    Here are 9 sudoku games with 9x9 sudoku grids inside.

    body {
      margin: 0;
      padding: 0;
    }
    div {
      overflow: hidden;
      box-sizing: border-box;
    }
    .outer-grid {
      position: relative;
      float: left;
      width: 33.3%;
      padding-bottom: 33.3%;
      border: 1px solid gray;
      background-color: #9cc;
    }
    .outer-square {
      position: absolute;
      left: 0;
      top: 0;
      width: 90%;
      height: 90%;
      background-color: #ccc;
      margin: 5%;
      display: -webkit-flex;
      -webkit-flex-wrap: wrap;
      display: flex;
      flex-wrap: wrap;
    }
    .inner-grid {
      width: 33.3%;
      height: 33.3%;
      border: 1px solid red;
      display: table;
    }
    .inner-square {
      line-height: 100%;
      font-size: 50px;
      font-weight: bold;
      display: table-cell;
      text-align: center;
      vertical-align: middle;
    }
    1
    2
    3
    4
    5
    6
    7
    8
    9
    1
    2
    3
    4
    5
    6
    7
    8
    9
    1
    2
    3
    4
    5
    6
    7
    8
    9
    1
    2
    3
    4
    5
    6
    7
    8
    9
    1
    2
    3
    4
    5
    6
    7
    8
    9
    1
    2
    3
    4
    5
    6
    7
    8
    9
    1
    2
    3
    4
    5
    6
    7
    8
    9
    1
    2
    3
    4
    5
    6
    7
    8
    9
    1
    2
    3
    4
    5
    6
    7
    8
    9

提交回复
热议问题