It's not working because you removed your width and height, so there was no overflow to hide.
The parent div
.wrape just expanded to whatever was hanging out.
/*display:table; remove this*/
width: 266px; /* put this back*/
height: 174px; /* put this back*/
If you want to use flex or grid you should to start from the ground up and code accordingly for whatever layout model you choose.
Rather than using existing code and randomly replacing properties without an understanding of the new layout rules those properties will introduce.
That page was originally set up for using floats on the anchors.