gpt4 book ai didi

css - 元素的颜色变化在移动浏览器 (iPad) 上无法正常工作

转载 作者:行者123 更新时间:2023-11-28 18:14:56 24 4
gpt4 key购买 nike

我正在使用 WooCommerce 构建一个电子商务网站 ( as seen here ),我已经使用以下代码更改了“添加到购物车”按钮的颜色:

.woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt, .woocommerce #respond input#submit.alt, .woocommerce #content input.button.alt, .woocommerce-page a.button.alt, .woocommerce-page button.button.alt, .woocommerce-page input.button.alt, .woocommerce-page #respond input#submit.alt, .woocommerce-page #content input.button.alt {
background: -moz-linear-gradient(center top , rgb(26, 22, 27) 0%, rgb(26, 22, 27) 100%) repeat scroll 0% 0% transparent !important;
border-color: rgb(26, 22, 27) !important;
color: rgb(255, 255, 255);
text-shadow: 0px -1px 0px rgba(0, 0, 0, 0.6);
}

由于某种原因,颜色变化只是发生在计算机屏幕上。当我在 iPad 或 iPhone 上查看网站时,添加到购物车按钮是蓝色的,而不是我想要的黑色。我已经在另一个站点(不同的域和主机)上尝试了该代码,它运行良好,并为所有设备将按钮变为黑色。

可能是什么问题?

最佳答案

我相信这是因为你正在使用

 -moz-linear-gradient(center top , rgb(26, 22, 27) 0%, rgb(26, 22, 27) 100%)

这是 mozilla 独有的。由于 iDevices 不使用 mozilla,因此无法正确呈现。

其他浏览器的等价物是

-webkit-gradient //Safari, chrome, etc. Webkit browsers
-webkit-linear-gradient // see above
-o-linear-gradient //Opera
-linear-gradient

关于css - 元素的颜色变化在移动浏览器 (iPad) 上无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18018189/

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