relative-positioned element is cut off
I'm having a problem with position relative and absolute, the content of the header doesn't show properly. but it's cut
Note: removing the position relative might fix the issue on the pen, but it makes the header scroll in my other code (the pen is a quick example)... So my solution can't be to remove the position relative
Pen: https://codepen.io/n00bCod3r/pen/yLdrOeP
Here's what happens if I remove position relative in my code when I scroll. (The style and html are identical to the one of the pen)
2 Replies
It is cut-off (clipped) because you have set overflow-y: auto.
Presumably you want to be able to scroll the contents of box so you need to set this overflow property on the element that hold s the content, not on the outer element. You will also need to add the height to this element.
I'll try improving rhe code
Yeah that seems to work, thanks