如何给网格的列和行设置边框?

时间:2020-08-21 20:19:17

标签: html css

基本标题。这是代码:

body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: red;
}

#gameboard {
    justify-content: center;
    align-items: center;
    display: grid;
    background-color: blue;
    border: 1px solid black;
    width: 500px;
    height: 500px;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
}
<!DOCTYPE html>
<html>
    <head>
        <link rel = "stylesheet" type = "text/css" href="css.css">
    </head>
    <body>
        <div id = "gameboard"></div>
    </body>
    <script type = "text/javascript" src = "js.js"></script>
</html>

如果您进入摘录中的整页,您会看到一个8x8的网格-如何为每一行和每行赋予黑色边框(有点像跳棋游戏板一样)?

提前谢谢!

0 个答案:

没有答案
相关问题