문제

I've created a sticky navigation bar that resizes when scrolling down. In this navigation bar I created one relative (parent) div called header_wrap containing two absolute (child) divs. When doing this the content of those child divs is not visible anymore.

When removing the option position: relative; from the parent div header_wrap the content of the child divs become visible however at that moment they ignore the given width of 970px in the header_wrap.

I created a jsfiddle to demonstrate: http://jsfiddle.net/wvUWR/1/

도움이 되었습니까?

해결책

it's because you are absolute positioning elements inside of a parent with no specified height. set #header_wrap to height: 100%;.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top