gpt4 book ai didi

html - 在媒体查询调整大小时交换背景图像

转载 作者:太空宇宙 更新时间:2023-11-03 17:37:38 25 4
gpt4 key购买 nike

您好,我有 2 个标题图片,1 个用于桌面设备,1 个用于平板电脑和移动设备。

当调整屏幕大小或在这些设备之一上查看时,如何从 PC 标题图像切换到移动/平板电脑标题图像

最佳答案

假设设置的宽度为 300px:

#header{
background:url('first URL Here')
}

@media screen and (max-width: 300px) {
#header {
background:url('second URL Here')
}
}

关于html - 在媒体查询调整大小时交换背景图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29577209/

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