【问题标题】:What is wrong in this code? displays white color background instead of image这段代码有什么问题?显示白色背景而不是图像
【发布时间】:2016-12-08 20:12:53
【问题描述】:

我使用引导程序。我的CSS在这里。它仅在此图像内显示白色背景。

.container-header
    {
        max-width:1000px;
        background:url(../images/header-secondrow-new.png);
        background-repeat: repeat-y;
        background-size: 100%;
    }

【问题讨论】:

  • 很抱歉,我不明白您在期待什么...您希望您的图像水平和垂直重复吗?您的container-header 中是否有任何内容或只有图像?你希望这个容器有多高?
  • 感谢您的回复....我已修复它..

标签: html css


【解决方案1】:

试试这个:

background-image: url(../images/header-secondrow-new.png);
background-repeat: repeat;
background-position: center top;

【讨论】:

    【解决方案2】:

    您的 css 代码中没有高度值是您没有给出高度值并且没有在该元素中添加任何内容,您看不到任何东西。尝试将 height:100px 添加到 css 类。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-11
      • 1970-01-01
      • 2022-06-10
      • 2012-10-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-02-07
      相关资源
      最近更新 更多