Alexander Abramovich
Alexander Abramovich

Reputation: 11438

Fixed position element that... moves?

Just found the link with a visible element with position:fixed behaves kinda strange:

http://www.steadyhealth.com/Do_you_need_to_use_a_back_up_method_for_the_first_week_of_every_month_while_on_birth_control__t267326.html

The element is div with id equals to centerMessages. It appears to be green, visible and ... moving. How come that a fixed element is moving as the page is scrolled? Or, in other words, which part of the spec I need to re-read/re-learn please?

Upvotes: 0

Views: 1081

Answers (2)

Sjoerd
Sjoerd

Reputation: 75598

The div does not move when you scroll. It contains no content, so you can't see it.

Upvotes: 2

wrren
wrren

Reputation: 1311

Fixed position just means that the element doesn't move relative to the scroll position of the page; it can still be given a position relative to the browser window. You can change this position using CSS and Javascript.

Upvotes: 1

Related Questions