1

I am trying to start grid column from half of the very first column.

I tried grid-start-column with different values but it's not working. Basically, it should be like following:

grid-column: 0.5/7

I know this is not the valid code, but just for explanation I write that.

Is it possible to start a column from the half of the column?

Arshad Hussain
  • 765
  • 5
  • 22

1 Answers1

2

Is it possible to start a column from the half of the column?

No. It is not.

Let's say you have a grid container with five columns and want to start spanning from halfway inside the first column (grid-column: 1.5 / 5 ). This won't work because you're not starting at a column line. More technically, the grid-row-* and grid-column-* properties accept only integers as values.

However, there is a simple workaround:

  • Instead of five columns use 10 columns.

  • Then start spanning at the third column (grid-column: 3 / 10).

This creates an equivalent layout, which looks the same visually, but with more precise control of the columns.

More details here: Changing div heights using CSS grid

Michael Benjamin
  • 346,931
  • 104
  • 581
  • 701