HTML Can't Change Height of Div

后端 未结 2 1803
我在风中等你
我在风中等你 2021-01-18 09:36

So I\'m working on a tic tac toe game but for some reason my divs won\'t change their height.

2条回答
  •  时光取名叫无心
    2021-01-18 09:53

    That is because you don't have a height to the board and the 30% of almost 0 is... 0.

    Add some height to the div with the id of board.

    Add this to your css:

    html {
      background-color:black;
      color:white;
      text-align:center;
    }
    #board{
     height:300px;
    }
    .cell {
      border: 1px solid white;
      margin:1px;
      width:30%;height:30%;
    }
    

提交回复
热议问题