Responsive grid of squares within a responsive grid of squares

后端 未结 4 1091
失恋的感觉
失恋的感觉 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:47

    I'm suggesting another approach - you can decide for yourself if it will be convinient in the long run:

    https://jsfiddle.net/3t17kuzu/3/

    The example is with a 33.3% width of the elements.

    .sg-3 {
        width: 33.3333%;
        float: left;
        position: relative;
        height: 0;
        padding-top: 33%;
        position: relative;
        outline: 1px solid black;
    }
    

提交回复
热议问题