Answer the question
In order to leave comments, you need to log in
How to properly prepare CSS GRIDs?
Good day colleagues!
Please tell me if I understand the following features of CSS Grid correctly:
1. Set a background (background) to a grid cell (or a set of cells - you can't)
2. Suppose we have a grid grid with 12 columns and 20 rows. I want to name a certain set of rows/columns, suppose I want to name the cells of the first row: 1st column - "left", 12th (last) column - "right", intermediate 10 columns - "header".
Accordingly, I will have to write 12 words ( cell names, for one line), since the construction that would do something like: or in relation to the element whose specified In other words, for example:grid-template-areas: "left header[10] right";
grid-template-areas: "left header(10) right";
, where the number of cells with the same name is indicated in brackets, does not currently exist.display: grid;
<ul>
<li>
<a href="#">Ссылка</a>
</li>
<li>
<a href="#">Ссылка</a>
</li>
<li>
<a href="#">Ссылка</a>
</li>
</ul>
If you specify UL 's display: grid; , then we can only distribute LI 's on the grid, but not the A 's nested in them, regardless of their positioning and other parameters.
Answer the question
In order to leave comments, you need to log in
1. Yes, you can't.
2. Also true. You have to write grid-template-areas: "left header ... header right";
3. Subgrids or display: contents; Already explained in the comment.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question