Relative Content

Tag Archive for csscss-grid

Flexible elements between min and max width with CSS grid?

I’m trying to achieve some particular behaviour with grid but I have a problem. I’m using grid-template-columns: repeat(auto-fit, minmax(260px, 400px)); To my understanding it should flex between 260px and 400px – in other words, width of the element in grid should start at 260px, then expand to maximum of 400px as width of the viewport increases, and then when space allows for it, it should add another element into the row and shrink back all elements in the row to 260px, and then repeat the process…if that makes sense. Unfortunately all elements always stay at 400px all the time and never shrink to 260px. Is there a way to achieve what I want with grid but without to much complication?

Size grid rows intrinsically based off content

Row 1 should always be the height of its content + 1 share of the remaining available space Row 2 should always be the height of its content Row 3 should always be the height of its content + 2 shares of the remaining available space .container{ height: 150px; width: 75px; resize: vertical; overflow: auto; […]

Merge rows in CSS subgrid

I have 2 columns (both a DIV) with each multiple rows (also DIV per row). I made this with css grid and subgrid.

Merge rows in CSS subgrid

I have 2 columns (both a DIV) with each multiple rows (also DIV per row). I made this with css grid and subgrid.

Align child elements of different blocks

I have a list of wares. I need to show them in a 2-dimensional list. Every ware has daughter elements: photo, title, description, price and buy button, which must be sized and positioned in this way: all titles, description, price and photo in a wares row must be at the same y-coordinate position and have height which is maximum of corresponding height element in a row.