gpt4 book ai didi

css - 用移动设备的颜色替换背景图像

转载 作者:太空宇宙 更新时间:2023-11-03 23:05:16 26 4
gpt4 key购买 nike

我一直在搜索和尝试不同的东西,但我什么都做不了。我在 this page 的顶部有一个背景图片顶部有浅黄色文字。

我正在使用此代码使其响应。

.homepage-intro{ 
background: url('http://inboundmarketing.digitalhive.buzz/hubfs/dec-2015-images/bee-flower-purple.png') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

但在移动设备上,浅黄色文本位于花朵浅黄色部分的顶部,所以我想将图像换成颜色 #634356,但我通过搜索和使用建议的代码尝试的任何方法都不起作用。

谢谢。

最佳答案

CSS 中尝试此媒体查询以及您的 noraml CSS

@media only screen 
and (min-device-width: 320px)
and (max-device-width: 480px)
and (-webkit-min-device-pixel-ratio: 2) {
.homepage-intro{
background: #yourColor;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
}

/*normal css*/
.homepage-intro{
background: url('http://inboundmarketing.digitalhive.buzz/hubfs/dec-2015-images/bee-flower-purple.png') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

关于css - 用移动设备的颜色替换背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34969514/

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