Marto
Marto

Reputation: 17

Element keeps scrolling with page

I created a banner but the item keeps scrolling and sticks on top of the page even when I have put the fixed position. I want to make it to be visible only when you are on top of the page and hide when you scroll down.

I am using

position:fixed; bottom: 0; padding:0; margin:0; width: 100%;

Upvotes: 0

Views: 115

Answers (1)

Will Baum
Will Baum

Reputation: 11

You can read up on CSS positions here.

Basically position: fixed will 'stick' to where the element is first rendered (in your case at the top).

If you want it to act like a normal element change the position: fixed to position: absolute or position: static or just remove the position style entirely.

I hope this awnsers your question!

Upvotes: 1

Related Questions