gpt4 book ai didi

javascript - 如何测试 css(3) 样式属性值支持、重复值支持?

转载 作者:行者123 更新时间:2023-11-28 13:37:39 25 4
gpt4 key购买 nike

我正在尝试检测 css3 属性是否支持给定值。例如,我如何测试 -moz-transform 是否支持 rotateX(val) 值。已知 -moz-transform 支持矩阵、倾斜、旋转但不支持 3d rotateX(目前仅 webkit 浏览器支持)。我怎样才能测试它?有什么想法吗?

最佳答案

要测试 3d 转换支持,您需要测试“透视”,

在伪代码中...

for prefix in prefixes
element.style[prefix + "-perspective"] = 1;
if element.style[prefix + "-perspective"]
return true

关于javascript - 如何测试 css(3) 样式属性值支持、重复值支持?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9047264/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com