【问题标题】:Swap Background Images On Media Query Resize在媒体查询调整大小时交换背景图像
【发布时间】:2015-04-11 11:12:28
【问题描述】:

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

当屏幕被调整大小或在其中一台设备上查看时,我如何从 pc 标题图像切换到移动/平板电脑标题图像

【问题讨论】:

    标签: html css responsive-design media-queries


    【解决方案1】:

    假设设置的所需宽度为 300px:

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

    【讨论】:

    • 我如何标记为完美回答。当场我只需要摆弄我的导航等,不断向你们学习新东西,非常感谢。
    • 谢谢。您既可以点击顶部箭头(正点),也可以点击复选标记以说出哪个答案解决了您的问题。这些选项位于答案的左侧
    • 投票需要 15 个代表大声笑试试这个 1 stackoverflow.com/questions/29675029/image-uploader-and-slider
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-06-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-28
    • 2016-11-30
    • 2018-04-17
    相关资源
    最近更新 更多