我正在研究这个 website如您所见,我使用 mp4 视频作为背景。
此 BG 视频不适用于移动设备,为此我必须使用后备图片。
问题是在页面加载时,此图像会显示 1 或 2 秒。是否可以在桌面上完全隐藏它?
有什么建议吗?
最佳答案
使用 CSS3 媒体查询去除背景,如下所示
@media only screen and (min-width: 769px) {
#idOfElementToHide {
background-image: none !important; // assuming that you are using inline styles you'll have to add !important to make sure this overrides the inline styles
}
}
关于javascript - 在桌面上隐藏后备图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37680617/