Okay, here we go, let me share my experience with “leo cancer”.

Alright folks, so I dove headfirst into something I’m calling “leo cancer” – sounds dramatic, right? Let me break it down. Basically, I wanted to try out different layout using CSS grid.
First thing I did was fire up my code editor. I created a simple HTML structure. Nothing fancy, just a container div and a bunch of child divs inside. Each child div represented a different section of my pretend webpage. I just wanted a basic structure to work with.
Next, the fun began! I started messing with the CSS. I set the container div to display: grid;
. Then, I started defining the grid’s rows and columns using grid-template-rows
and grid-template-columns
. This is where things got interesting.
I initially tried using fixed pixel values for my rows and columns, but that felt way too rigid. So, I switched to using fr
units (fractional units). This was a game-changer! The fr
unit allows you to divide the available space proportionally between rows and columns. For example, grid-template-columns: 1fr 2fr;
would create two columns, where the second column is twice as wide as the first.
After that, I played around with grid-gap
to add spacing between the grid items. I also experimented with grid-row-start
, grid-row-end
, grid-column-start
, and grid-column-end
to position specific items within the grid. This allowed me to make some elements span multiple rows or columns.

One tricky bit was making the layout responsive. I used media queries to adjust the grid layout based on screen size. For smaller screens, I switched to a single-column layout using grid-template-columns: 1fr;
. This made sure the layout looked good on both desktop and mobile devices.
I faced some minor browser compatibility issues, especially with older versions of Internet Explorer. To address this, I used Autoprefixer to automatically add vendor prefixes to my CSS rules. This ensured that the layout worked consistently across different browsers.
The final result? A simple, responsive grid layout that I could easily adapt for different projects. It wasn’t perfect, but it gave me a solid understanding of how CSS Grid works.
Key Takeaways:
- Embrace
fr
units: They make creating flexible layouts a breeze. - Use media queries: Essential for responsive design.
- Autoprefixer is your friend: Handles browser compatibility.
Overall, “leo cancer” was a fun and educational experience. I encourage you to try it out yourself. Just start with a simple grid and experiment with different properties. You’ll be surprised at what you can create!