3 useful tricks for CSS Grids 🔥

Опубликовано: 31 Август 2024
на канале: julián Vélez
2,181
234

3 useful tricks for CSS Grids 🔥

🔹 Center items:

Once you set display grid to a parent container, centering items inside it both vertically and horizontally is just a matter of setting place-items: center 😁 It can't get easier!

🔹 minmax

It is a function that can be used to tell how small and how large your element can get. Here we are using it in a sidebar to clamp it between 100px and 200px 😎

🔹 Header and footer

By using the template auto 1fr auto, we can make the main content fill up as much space available after accomodating the header and footer. Without grids this would be difficult to achieve!

Hope you found this helpful, share your thoughts in the comments 💬

#css
#html
#css3
#csstricks
#frontend
#webdesign
#webdeveloper
#webdevelopment
#frontenddeveloper
post by post by ‪@baby_wolf_codes‬