{"id":375172,"date":"2022-11-22T06:16:43","date_gmt":"2022-11-22T14:16:43","guid":{"rendered":"https:\/\/css-tricks.com\/?page_id=375172"},"modified":"2022-11-22T06:16:44","modified_gmt":"2022-11-22T14:16:44","slug":"grid-area","status":"publish","type":"page","link":"https:\/\/css-tricks.com\/almanac\/properties\/g\/grid-area\/","title":{"rendered":"grid-area"},"content":{"rendered":"\n
The grid-area<\/code> CSS property is a shorthand that specifies the location and the size of a grid item in a grid layout by setting the value of
grid-row-start<\/code><\/a>,
grid-column-start<\/code><\/a>,
grid-row-end<\/code><\/a> and
grid-column-end<\/code><\/a> in one declaration.<\/p>\n\n\n\n
.grid-container {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));\n}\n\n.grid-item:nth-child(2) {\n grid-area: 2 \/ 4 \/ 4 \/ 6;\n\n \/* is equivalent to: *\/\n grid-row-start: 2;\n grid-column-start: 4;\n grid-row-end: 4;\n grid-column-end: 6;\n}<\/code><\/pre>\n\n\n\n