0

html

<!DOCTYPE html>
<html>
<head>
<title>test</title>
<meta charset="UTF-8" />
</head>
<body>
<div id="square"></div>
</body>
</html>

css

    * {
            margin: 0;
        }

        body {
            display: grid;
            grid-template-rows: 100%;
            grid-template-columns: 3fr 3fr 3fr;
        }

        #square {
            grid-row: 1;
            grid-column: 2;
            background-color: red;
            width: 100px;
            height: 100px;
        }

i want the square centered in the middle horizontally

tried justify-self space around but it didnt work

0 Answers0