W3C home > Mailing lists > Public > www-style@w3.org > May 2014

[css3-background] Background positioning area of root element when background-attachment is fixed

From: Xianzhu Wang <wangxianzhu@chromium.org>
Date: Thu, 22 May 2014 12:15:26 -0700
Message-ID: <CADBxridBqD_GgR_xeqaCkUs=YTe43ndVAfn=+uEYnccHBKe-+Q@mail.gmail.com>
To: "www-style@w3.org" <www-style@w3.org>
Hi,

http://www.w3.org/TR/css3-background/#special-backgrounds says
"the background positioning area is determined as for the root element".
However I tested several browsers (Chrome, IE10, Firefox, Safari) and they
all seem not to conform this.

Test case is like:
<!DOCTYPE html>
<style>
body {
  background-image: linear-gradient(white, yellow);
  background-attachment: fixed;
}
</style>

http://jsbin.com/pepufelo/1/ (gradient) and
http://jsbin.com/pepufelo/2(real image with background-size: 100%
100%) also allow you to toggle
between 'fixed' and 'scroll' background-attachment by clicking on the page.

On my tested browsers, when background-attachment is fixed, the viewport
(instead of the root element) is used as the background positioning area.
I'm wondering if this behavior has been specified or is a known issue.

Thanks,
Xianzhu
Received on Thursday, 22 May 2014 19:15:54 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:51:27 UTC