Background center with chrome (bug)

前端 未结 7 1449
后悔当初
后悔当初 2021-02-06 05:44

I have a background image centered that Chrome displays offset by one pixel.

CSS

#container { 
    background: url(\"images/header.jpg\"         


        
7条回答
  •  囚心锁ツ
    2021-02-06 06:24

    If you make the background image width an odd number (987px) the positioning will be consistent across all browsers. It seems counter-intuitive but that seems to always fix the issue for me without any CSS hacks.

提交回复
热议问题