home  -  about me  -  2009  -  2008  -  2007  -  2006  -  2005  -  nerd's substance  -  itch  -  shuffle  -  what
Mac  -  Photos
  Livid's Paranoid - nerd's substance - Firefox 3.0 Beta 的 CSS background 问题   
Firefox 3.0 Beta 的 CSS background 问题
自从 Firefox 3.0 发布了第一个 Beta 版本之后,我就开始用它来测试我开发的各个网站在上面的表现了。其中,V2EX 在 Firefox 3.0 上出现了一个很奇怪的问题:在页面加载完成之后,页面的 main column 和背景图片无法对齐,会出现一条宽度 10px 左右的位移。

周日下午和 Leechael 一起花时间看了一下这个问题,因为 Firefox 3.0 发布在即,而我们又都是苛刻的人,当然不希望页面上有任何期望之外的事情发生。

V2EX 的背景图是一张从高处拍摄的城市景色,使用 background: #000 url("/img/bg_city.jpg") no-repeat fixed 50% 0; 方式在页面上定位。当 viewport 的高度发生变化导致滚动条出现和消失的时候,Firefox 3.0 Beta(或者更确切地说,这个版本的 Gecko)并不会动态更新 background-attachment: fixed 情况时 background-position 和 viewport 的对齐。

这有可能是这个版本的 Gecko 的一个 bug,同样的不符合期待的行为在 Firefox 2 及其他主流浏览器上是不存在的。

所以最后我们针对这个情况,在 V2EX 中,如果检测到用户在使用 Firefox 3.0 Beta 访问,那么一句特殊的 CSS override 就会生效。这个方式不够环保,期望 Firefox 3.0 正式版中能够解决这个问题吧。我在 Mozilla 的 Bugzilla 里搜索了一下,似乎关于 CSS background 属性的问题不少。 [tags]v2ex, babel, css, background[/tags]
自从 Firefox 3.0 发布了第一个 Beta 版本之后,我就开始用它来测试我开发的各个网站在上面的表现了。其中,V2EX 在 Firefox 3.0 上出现了一个很奇怪的问题:在页面加载完成之后,页面的 main column 和背景图片无法对齐,会出现一条宽度 10px 左右的位移。

周日下午和 Leechael 一起花时间看了一下这个问题,因为 Firefox 3.0 发布在即,而我们又都是苛刻的人,当然不希望页面上有任何期望之外的事情发生。

V2EX 的背景图是一张从高处拍摄的城市景色,使用 background: #000 url("/img/bg_city.jpg") no-repeat fixed 50% 0; 方式在页面上定位。当 viewport 的高度发生变化导致滚动条出现和消失的时候,Firefox 3.0 Beta(或者更确切地说,这个版本的 Gecko)并不会动态更新 background-attachment: fixed 情况时 background-position 和 viewport 的对齐。

这有可能是这个版本的 Gecko 的一个 bug,同样的不符合期待的行为在 Firefox 2 及其他主流浏览器上是不存在的。

所以最后我们针对这个情况,在 V2EX 中,如果检测到用户在使用 Firefox 3.0 Beta 访问,那么一句特殊的 CSS override 就会生效。这个方式不够环保,期望 Firefox 3.0 正式版中能够解决这个问题吧。我在 Mozilla 的 Bugzilla 里搜索了一下,似乎关于 CSS background 属性的问题不少。
Technorati Tags: , , ,
by ~Livid - [ nerd's substance ] - 2007-11-25 01:29:46 - 2007-11-25 01:29:46 - 5686+5010
Sponsor
M6
这里的评论功能已经关闭,如果你觉得这不公平,那么请到 V2EX 发表你的看法 > V2EX.com
Look Around...
Maybe you will be interested on these?
Mementos: Do you remember
  
  
    Mac.6.cn footbig.com go.6.cn
    RSS 2.0 XML Feed Valid RSS 2.0 XML Feed Get Firefox!
    PHP Powered!  Subscribe with Bloglines!
    Livid: Livid Von Torvalds
    This is the personal site of Xin Livid Liu. It started since 2005.

    You can view my more detailed profile on LinkedIn and Facebook. Or follow me on Twitter.

    This site is up for 2029 days, 930 articles have been viewed for 5753799+3684266 times, average 6186.88 times per article, regularly there are 3.21 new articles per week.
    Buddies: Dear
    Links: Outside the Window
    vik|coon - 38.107.191.116 - CCBot/1.0 (+http://www.commoncrawl.org/bot.html)

    vik|engine - This installation on Apache has got 10053515 overall meaningful hits.

    Project VIK - $Id: lividecay.php 8 2007-02-03 22:47:45Z livid $
      All my works, except where otherwise noted, are licensed under a Creative Commons License

      Technorati Profile

      Extreme fear can neither fight nor fly.
      		-- William Shakespeare, "The Rape of Lucrece"