【问题标题】:Place image in responsive footer将图像放置在响应式页脚中
【发布时间】:2021-03-10 21:27:51
【问题描述】:

我想将下面的图片放在响应式页脚中。

当宽度为 400 像素时,我想在页脚中显示图像,如下所示。我想像以前一样保持高度。我该怎么做?

【问题讨论】:

  • 请添加一个代码,它将向我们展示您到目前为止所做的事情

标签: html css responsive-design responsive responsive-images


【解决方案1】:

你可以设置背景为

背景:#eee url(image_path) center center; 并设置max-wdith=100%,同时将高度设置为固定的px值;

见下文:

#catcat {
            background: #eee url(https://i.stack.imgur.com/wyc3V.jpg) center center;
            max-width: 100%;
            height:300px;

        }
<div id=catcat></div>   

【讨论】:

    猜你喜欢
    • 2017-06-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-03-02
    • 2013-07-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多