Make a grid element span to the full width of the parent

WBOY
Release: 2024-07-18 22:12:03
Original
624 people have browsed it

Make a grid element span to the full width of the parent

No buildup. Let's get to the point.

You have a grid container, and it has some child elements divided into as many columns as you want. For now, let's say the grid container has seven elements, and those elements are divided into three columns. You want the seventh element to take up the full width of the parent.

Here's the code snippet.

.seven {
    grid-column: 1 / span 3;
}
Copy after login

Checkout a full example here: https://codepen.io/ccgaejza-the-selector/pen/dyELmRE

The above is the detailed content of Make a grid element span to the full width of the parent. For more information, please follow other related articles on the PHP Chinese website!

source:dev.to
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!