gpt4 book ai didi

html - Firefox 和 Chrome 的不同背景位置

转载 作者:太空宇宙 更新时间:2023-11-03 21:45:14 24 4
gpt4 key购买 nike

我在 div 中使用图像作为背景,我想对 Firefox 和 Chrome 使用不同的定位。

我想将这个用于 Mozila:

background-position: left -14px bottom -1px !important;

我想将这个用于 Chrome:

background-position: left -14px bottom -2px !important;

这可能吗?请给我建议..

最佳答案

您可以为 FF 和 Chrome 使用特定的选择器:

以 Chrome 为目标:

@media screen and (-webkit-min-device-pixel-ratio:0) {
.yourElement {
background-position: left -14px bottom -2px !important;
}
}

以 FF 为目标:

@-moz-document url-prefix() { 
.yourElement {
background-position: left -14px bottom -1px !important;
}
}

这比使用用户代理要好得多。

关于html - Firefox 和 Chrome 的不同背景位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20989891/

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