Understanding the Distinction between "align-items" and "align-content" in Grid Layout
The Grid Layout module introduces two sets of properties, "justify/align-items" and "justify/align-content," which play distinct roles in aligning grid items and the grid itself within a grid container.
Grid Terminology Clarification
Align-items vs. Align-content
The "align-items" and "align-content" properties, as their names suggest, align grid items and the grid, respectively. Specifically:
Addressing the Author's Claim
The author's claim that the "-content" properties exist because "sometimes the total size of your grid might be less than the size of its grid container" highlights the following:
Illustrations for Clarity
[Image of illustration from W3C showing a grid smaller than its container, with "justify-content" and "align-content" aligning the grid within the container.]
Excerpt from the Specification
For clarity, relevant excerpts from the CSS Grid Layout specification are provided:
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