css - background-position使用疑惑。
伊谢尔伦
伊谢尔伦 2017-04-17 13:54:53
0
6
832

DEMO

我看文档上是这样写的:

A percentage for the horizontal offset is relative to (width of background positioning area - width of background image). A percentage for the vertical offset is relative to (height of background positioning area - height of background image), where the size of the image is the size given by ‘background-size’.

那么为什么10%就会偏移那么多呢?
不解。

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

全部回复 (6)
洪涛

没看到你的代码效果,不好怎么说,先给个链接吧

    大家讲道理

    bgp 的坐标只用负值定位~

      迷茫

      10%就会偏移那么多,要看你盒子(图片)本身大小吧,这个是相对的。

        阿神

        关键看你如何定位,建议把源码拿出来看看

          黄舟

          这个属性设置background-image的位置,也看你怎么定位盒子和图片的大小

            洪涛

            看百分比的计算方式, 是把图片的10%对应的位置,与背景定位的10%对应位置对齐。

              最新下载
              更多>
              网站特效
              网站源码
              网站素材
              前端模板
              关于我们 免责声明 Sitemap
              PHP中文网:公益在线PHP培训,帮助PHP学习者快速成长!