<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/extracting-grid-information-using-css-master-dev-blog-1k0d7bgns" -->

---
title: Extracting Grid Information Using CSS – Master.dev Blog
description: A deep-dive technique shows how to extract grid item positions (column/row start and end lines) purely in CSS, even when items are randomly placed and span...
canonical: https://daily.dev/posts/extracting-grid-information-using-css-master-dev-blog-1k0d7bgns
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Extracting Grid Information Using CSS – Master.dev Blog | daily.dev
og:description: A deep-dive technique shows how to extract grid item positions (column/row start and end lines) purely in CSS, even when items are randomly placed and span...
og:url: https://daily.dev/posts/extracting-grid-information-using-css-master-dev-blog-1k0d7bgns
og:image: https://api.daily.dev/og/posts/1k0d7bGNs.png
og:image:alt: Extracting Grid Information Using CSS – Master.dev Blog
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Extracting Grid Information Using CSS – Master.dev Blog

**[Frontend Masters](https://daily.dev/sources/frontendmasters)** · 15 min read · 3 upvotes · 0 comments

## Summary

A deep-dive technique shows how to extract grid item positions (column/row start and end lines) purely in CSS, even when items are randomly placed and span multiple rows and columns. The approach relies on Scroll-Driven Animations (view-timeline, animation-range, entry-crossing/exit-crossing) to track each side of an element relative to its scroll container, then converts the animated progress values into integer grid coordinates using round() and calc(). It also tackles calculating an auto-height container's height in pure CSS via a hacky scroll-timeline trick referencing an earlier article. As of writing, only Chrome and Edge fully support the required features.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://blog.master.dev/extracting-grid-information-using-css>

## Questions this post answers

### How can I get the row and column position of a grid item that spans multiple rows or columns using only CSS?

Use Scroll-Driven Animations by defining a view-timeline on each item along the x and y axes, then set animation-range with entry-crossing and exit-crossing values offset by the column or row size to normalize the item's edge position into a 0-1 range. Multiply that value by (number of columns or rows - 1), add 1 or 2, and round it to get the integer start and end grid line.

_Developers wiring up custom grid layouts can save techniques like this one on daily.dev before the next CSS grid debugging session._

### Why does 100cqh not work for getting the height of an auto-height grid container in CSS?

Container query height (100cqh) fails because enabling container-type: size on an element with height: auto causes the container to collapse, making its height become 0. To get around this, a separate technique using a hidden pseudo-element and a scroll-driven view-timeline animation is needed to compute the actual rendered height in pure CSS.

_Track workarounds like this on daily.dev when auto-height containers keep breaking your container query calculations._

### Which browsers support the CSS features needed for scroll-driven-animation based grid position tracking?

Only Chrome and Edge fully support the Scroll-Driven Animations features (view-timeline, animation-range with entry-crossing and exit-crossing) required for this technique at the time of writing, meaning it is not yet safe for production use across all major browsers.

_Developers evaluating browser support before shipping experimental CSS can follow updates like this on daily.dev._

## Similar posts on daily.dev

- [Get Grid Information using pure CSS](https://daily.dev/posts/get-grid-information-using-pure-css-pfehfxsxb) · CSS Tip · 33 upvotes · 3 comments
- [Animating CSS Grid Layouts with CSS Anchor Positioning](https://daily.dev/posts/animating-css-grid-layouts-with-css-anchor-positioning-1ufjfyoc1) · Bram.us · 15 upvotes · 2 comments
- [Responsive CSS Grid Layout with Animation](https://daily.dev/posts/responsive-css-grid-layout-with-animation-gbusjvg4t) · CSS Tip · 34 upvotes · 0 comments
- [Hover Proximity Using Modern CSS – Master.dev Blog](https://daily.dev/posts/hover-proximity-using-modern-css-master-dev-blog-wa5xjv85b) · Frontend Masters · 18 upvotes · 1 comments

---

Tags: [#css](https://daily.dev/tags/css)

[View this post on daily.dev](https://daily.dev/posts/extracting-grid-information-using-css-master-dev-blog-1k0d7bgns)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Extracting Grid Information Using CSS – Master.dev Blog","url":"https://daily.dev/posts/extracting-grid-information-using-css-master-dev-blog-1k0d7bgns","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/extracting-grid-information-using-css-master-dev-blog-1k0d7bgns"},"datePublished":"2026-09-16T19:03:26.546Z","dateModified":"2026-09-16T19:26:11.798Z","description":"A deep-dive technique shows how to extract grid item positions (column/row start and end lines) purely in CSS, even when items are randomly placed and span...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/297b714415bfedde584721882005fd3c?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/297b714415bfedde584721882005fd3c?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Frontend Masters","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Frontend Masters","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/d34dd87208f24090bfb0917307fcf89f","url":"https://daily.dev/sources/frontendmasters"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/extracting-grid-information-using-css-master-dev-blog-1k0d7bgns","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"css","timeRequired":"PT15M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Frontend Masters","item":"https://daily.dev/sources/frontendmasters"},{"@type":"ListItem","position":3,"name":"Extracting Grid Information Using CSS – Master.dev Blog"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/extracting-grid-information-using-css-master-dev-blog-1k0d7bgns#faq","mainEntity":[{"@type":"Question","name":"How can I get the row and column position of a grid item that spans multiple rows or columns using only CSS?","acceptedAnswer":{"@type":"Answer","text":"Use Scroll-Driven Animations by defining a view-timeline on each item along the x and y axes, then set animation-range with entry-crossing and exit-crossing values offset by the column or row size to normalize the item's edge position into a 0-1 range. Multiply that value by (number of columns or rows - 1), add 1 or 2, and round it to get the integer start and end grid line. Developers wiring up custom grid layouts can save techniques like this one on daily.dev before the next CSS grid debugging session."}},{"@type":"Question","name":"Why does 100cqh not work for getting the height of an auto-height grid container in CSS?","acceptedAnswer":{"@type":"Answer","text":"Container query height (100cqh) fails because enabling container-type: size on an element with height: auto causes the container to collapse, making its height become 0. To get around this, a separate technique using a hidden pseudo-element and a scroll-driven view-timeline animation is needed to compute the actual rendered height in pure CSS. Track workarounds like this on daily.dev when auto-height containers keep breaking your container query calculations."}},{"@type":"Question","name":"Which browsers support the CSS features needed for scroll-driven-animation based grid position tracking?","acceptedAnswer":{"@type":"Answer","text":"Only Chrome and Edge fully support the Scroll-Driven Animations features (view-timeline, animation-range with entry-crossing and exit-crossing) required for this technique at the time of writing, meaning it is not yet safe for production use across all major browsers. Developers evaluating browser support before shipping experimental CSS can follow updates like this on daily.dev."}}]}
```

