Explanation of the problem:
overflow: hidden doesnβt really work because you applied skewY to the after element after that, which does not affect the rest of the # header-top content.
However, I found this solution for your problem:
Remove: after. Apply skewY(-4deg) and background-color to <nav> and invert this conversion for the internal <ul> using skewY(4deg) . Now overflow: hidden will work when applied to <nav> .
A few new problems will appear: a small white triangle in the upper left corner (fix: padding-top and negative margin-top for <nav> ), and a red tilt is not enough for some elements (fix: use a larger padding-bottom ).
Remember to use a cross-browser backup for conversion (-webkit-, -moz-, -o-).
Applied Solution:
This solution applies in this JSFiddle: http://jsfiddle.net/v9dfjq4L/9/
source share