Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
190 views
in Technique[技术] by (71.8m points)

html - Fixed position is css overridden by absolute position. Can I get alternate solution for this?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

When you set position:fixed on your header, this means it has come out of the normal flow of execution.

With this some of your page's content is available but behind the header itself. so a margin-top equal to the header height on the element after header will fix it.

You can also use a z-index:10 ( a value more that the position:absolute div) to make it come on top of the page.

Coming to your second part of the question that fixed is changed to absolute. I don't see that happening here.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...