line name<\/a>, the placement algorithm will prefer to use the named grid area’s lines.<\/p>\n\n\n\nConsider the following example:<\/p>\n\n\n\n
.container {\n display: grid;\n grid-template-columns: 1fr [y] 1fr 1fr 1fr 1fr;\n grid-template-areas: \"x x x y y\";\n}<\/code><\/pre>\n\n\n\nThe second grid line is named y<\/code>, and the last two columns are defined as an area with the same name. Now, to position the first grid item, we assign y<\/code> as the value for grid-column-end<\/code>. Let’s see which line it will refer to:<\/p>\n\n\n\n.grid-item:first-child {\n grid-column-end: y;\n}<\/code><\/pre>\n\n\n\nAs you can see in the next image, although the y<\/code> line is closer to the first item, the browser chose the grid area’s edge to place the ending edge of the item.<\/p>\n\n\n\n