How to make CSS Grid items take up remaining space?

Adding grid-template-rows: 1fr min-content; to your .grid will get you exactly what you’re after :). .grid { display: grid; grid-template-columns: 1fr 3fr; grid-template-rows: 1fr min-content; grid-template-areas: “one two” “one three” } .one { background: red; grid-area: one; padding: 50px 0; } .two { background: green; grid-area: two; } .three { background: blue; grid-area: three; } … Read more

Understanding grid negative values

The grid-column and grid-row shorthand properties count grid lines. You wrote: For single span columns I can use grid-column: 1/1 This doesn’t make any sense. It resolves to: grid-column-start: 1 grid-column-end: 1 So you’re defining a column that goes from the starting line to the starting line. A column has a starting line and an … Read more

How to make images stay within the rows of a css grid container?

You can use grid-template-rows: 1fr 1fr 1fr and more importantly you have to reset the min-width and min-height values of the grid items which defaults to auto (as much as the content). To provide a more reasonable default minimum size for grid items, this specification defines that the auto value of min-width/min-height also applies an … Read more

Change the column order in a CSS grid

Grid Layout provides multiple methods for re-arranging grid items. I’ve listed four below. The grid-template-areas property Line-based placement The order property The dense function of the grid-auto-flow property. (Possibly the simplest, easiest and most robust solution for this type of layout, as it works for any number of grid items.) Here’s the original layout: grid-container … Read more

How can I make a div span multiple rows and columns in a grid?

I understand that you are seeking an answer that doesn’t involve HTML Tables or CSS Grid Layout. You mention that you don’t want Grid because of weak browser support. However, around the same time you posted your question, most major browsers released new versions which provide full support for Grid Layout (see details below). CSS … Read more