I set up a CSS grid, where row 1 is meant to only hold the title. Therefore, the title spans two columns. But when I specify the text-align: center, it only centers in the first column. How can I solve this? Or is grid not going to do what I want?
I believe this creates a two column, two row grid.
display: grid;
grid-template-columns: auto auto;
grid-template-rows: auto auto;
I put the title_text in row 1 and set it to use both columns.
.title_container {
grid-row: 1;
grid-column: 1 / 3; ( I also tried grid-column: 1 / span 2; )
}
The second row has two columns, each one with separate controls (pad_container and controls_container).
In CSS grid justify-self aligns the item in the inline axis (row), whereas align-self aligns the item in the block axis (column). This is slightly different to flexbox practices where justify-self works along the main axis and align-self on the cross axis, which is all dependent on the flex-direction (set to either row or column).
It does make some sense but there are cases where it always seemed to me like it would be handy. Like a header with nav links and a logo. You would use justify-content: flex-end; on the container and then justify-self: flex-start; on the logo. But that doesn’t work.
|------------------------------------|
| |
| Logo link link link |
| |
|------------------------------------|