前端 - 移动端网页设置的viewport 设置target-densitydpi有什么作用?
PHP中文网
PHP中文网 2017-04-17 13:39:47
0
1
404
荔枝FM
<meta name="viewport" content="width=640, user-scalable=no, target-densitydpi=device-dpi">
网易
<meta content="target-densitydpi=device-dpi,width=640,user-scalable=no" name="viewport">

这两个移动站都设置了target-densitydpi=device-dpi这个属性,我查了一下腾讯是这么说的

网上其他的文章是这么说的

2,这个属性只对android系统起作用,专有属性。iOS不支持它,所以说起来,还是有兼容性问题,如果页面是兼容IOS和android的话。

让我越来越蒙了,这个属性是用来干嘛的?兼容性差的话有必要用吗?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
Ty80

target-densitydpi is a private attribute that represents the density level of the target device. is used to determine how many physical pixels 1px in CSS represents

The target-densitydpi value can be a numeric value or one of the strings high-dpi, medium-dpi, low-dpi, device-dpi

Special note is that when target-densitydpi=device-dpi, 1px in css will be equal to 1px in physical pixels.
Because this attribute is only supported by Android, and Android has decided to abandon the target-densitydpi attribute, try to avoid using this attribute.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!