【问题标题】:Why do my images not show up after I change the file name?为什么更改文件名后我的图像不显示?
【发布时间】:2021-10-18 19:27:08
【问题描述】:

我想更改顶部的横幅图像,但是一旦我更改了图像,它们就不再显示了。有人可以检查我的代码,看看为什么它们没有出现吗?

.sub-header{
    height: 50vh;
    width: 100%;
    background-image: linear-gradient(rgba(4,9,30,0.7),rgba(4,9,30,0.7)),url(images/about-sub.jpg);
    background-position: center;
    background-size: cover;
    text-align: center;
    color: #fff;

【问题讨论】:

    标签: html css image filenames banner


    【解决方案1】:

    url 中添加quote-unquote,不要忘记关闭大括号。进一步阅读background-image

    .sub-header{
        height: 50vh;
        width: 100%;
        background-image: linear-gradient(rgba(4,9,30,0.7),rgba(4,9,30,0.7)),url("/images/about-sub.jpg");
        background-position: center;
        background-size: cover;
        text-align: center;
        color: #fff;
    }

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-04
      • 2014-08-26
      • 2010-10-15
      • 1970-01-01
      • 1970-01-01
      • 2019-12-10
      • 2023-03-20
      相关资源
      最近更新 更多