When constructing a Bootstrap grid for a portfolio page, you may encounter an issue where longer tiles cause a gap in the layout when stacking occurs. This issue arises due to the varying heights of elements within the grid. To resolve this, several solutions exist:
Here's a specific technique to resolve the issue:
Add a clearfix div after each grid element:
...
Apply a media query to the clearfix div to clear the float:
@media (max-width: 767px) { .portfolio>.clear:nth-child(6n)::before { clear: both; } }
This approach provides:
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