Borders Overlapped in Grid Layout
The borders overlapped when I created a Grid layout with bordered item.
I found a way to resolve this after tried several ways in different blos (none of them works).
Here’s the codes:
1 | // Container |
Yes, I use the ::after
style to make the item border, and change the border color when hovering item.
Notice that the position of ::after
element must be top: -1;
and left: -1;
, so that the border between two item will not be overlapped.
The z-index
style of hovered element is to cover the original border color.
原文作者: dgb8901,yinxing
原文链接: https://www.itwork.club/2021/05/14/grid-border-overlap/
版权声明: 转载请注明出处
为您推荐
体验小程序「简易记账」
关注公众号「特想学英语」