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

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伐。

Antworte allen(6)
洪涛

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

大家讲道理

bgp 的坐标只用负值定位~

迷茫

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

阿神

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

黄舟

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

洪涛

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

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!