Get the App
SLTechnology News&Howtos  ›  Development  › 

Description and example usage of grid layout in css

Shulou Source: shulou.com Published: 2022-06-03 17:32:33 10月30日 Update

This article mainly explains "the explanation and example usage of grid layout in css". The content of the explanation in this article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the explanation and example usage of grid layout in css".

Description

1. Set the attribute value to grid or inline-grid or subgrid through the display property.

2. When the grid layout is set for the element, the attributes column, float, clear and vertical-align are invalid.

Example

In CSS, grid-template-columns is not set, only grid-template-row is set.

.grid-container {display: grid; grid-template-rows: 50px 80px 100px; background: pink;} .item {border: 2px solid palegoldenrod; color: # fff; text-align: center; font-size: 20px } Thank you for your reading. The above is the content of "description and example usage of grid layout in css". After the study of this article, I believe you have a deeper understanding of the description and example usage of grid layout in css, and the specific usage needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Examples layouts attributes learning content elements that is ideas situations articles more knowledge knowledge points articles grids follow problems practice push research Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple vpn Redmi Huawei Shulou Tech Info