"If a worker wants to do his job well, he must first sharpen his tools." - Confucius, "The Analects of Confucius. Lu Linggong"
Front page > Programming > Make a grid element span to the full width of the parent

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

Published on 2024-07-30
Browse:894

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;
}

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

Release Statement This article is reproduced at: https://dev.to/sgvugaurav/make-a-grid-element-span-to-the-full-width-of-the-parent-3ecc?1 If there is any infringement, please contact study_golang@163 .comdelete
Latest tutorial More>

Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.

Copyright© 2022 湘ICP备2022001581号-3