【发布时间】:2021-11-07 15:18:08
【问题描述】:
大家好,
我一直在到处寻找以解决这个问题。但我做不到,这让我相信还有其他事情发生。让我们看看。
我希望为我的 Wordpress Bootstrap 网站上的横幅编写代码。 www.visionalmind.com 这个横幅应该放在导航栏的正下方,为此我在一个全宽容器内制作了一个。该类包括图像本身。
我的愿望是制作这样的横幅: https://www.w3schools.com/Css/tryit.asp?filename=tryresponsive_image_background3
这是 header_banner 的 CSS:
.header_banner{
max-width: 100%!important;
margin: auto!important;
width: 100%!important;
max-height: 1080px!important;
background-repeat: no-repeat!important;
background-attachment: fixed!important;
background-size:cover!important;
background-image: url('https://www.visionalmind.com/wp-content/themes/visionaltheme/media/photo-1499951360447-b19be8fe80f5.png');
}
HTML:
<div class="container-fluid bg-darkblue">
<div class="row mt-5">
<div class="container pad_over">
<a class="header_banner"></a>
</div>
</div>
</div>
我尝试了以下方法。
- 尝试使用“背景”属性代替“背景图像” 财产。
- 尝试使用 HTML 代替 This works,但我 得到伸展问题。我对想法持开放态度。
- 我已经在我的 url 栏中加载了 URL,以检查图像是否有效。
【问题讨论】:
-
您的标题横幅没有高度...
-
... 宽度也为零。
-
你试图给锚标签提供背景 尝试改变它,使用感谢大家的反馈。我已经全部实现了,但仍然没有结果。
标签: html css wordpress twitter-bootstrap background-image