Restoring [overflow auto] elements positions

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
Posts: 3
Joined: September 2nd, 2012, 12:58 am

Post Posted March 14th, 2019, 8:00 am


I noticed that Firefox (Firefox developer edition 67.0b1 (64-bit)) has a nice "feature". It remembers and restores position of div elements with "overflow auto" css style.

The problem here is that I would like to
  • control it (selectively enable for some elements and disable for others).
  • find and use this feature in other browsers. It seems this doesn't work in Chrome.

I tried to find documentation about this, but failed. I remember myself struggling to control the scroll position of overflow elements some years ago and came up with a solution using anchor names. It seems like there were some changes during this period, otherwise I would notice this feature.

The test to reproduce is the source below. Scroll to any vertical position and reload the page (F5). You will get the last scrolling position in FF and top position in Chrome

Any information would be great,


Code: Select all
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">

  .height100boxed {
    border: 1px solid rgb(150, 150, 180);
    height: 100px;

  .scrollarea {
    padding: 5px;
    overflow: auto;
    width: 200px;

  <div class="scrollarea height100boxed">

Return to Web Development / Standards Evangelism

Who is online

Users browsing this forum: No registered users and 3 guests