html - CSS背景:网址不起作用
问题描述
HTML代码是
<style>
.banner_image{
padding-top: 75px;
padding-bottom: 50px;
text-align: center;
color: #f8f8f8;
background: url(http://test.puurmondhygienist.nl/wp-content/uploads/2017/01/slide_bg_2400x1080.jpg) no-repeat center center;
background-size: cover;
}
.banner_content{
position: relative;
padding-top: 6%;
padding-bottom: 6%;
margin-top: 12%;
margin-bottom: 12%;
background-color: rgba(0, 0, 0, 0.7);
max-width: 660px;
}
</style>
<div class="banner_image">
<div class="container">
<center>
<div class="banner_content">
<h1>We Sell Lifestyle</h1>
<p>Flat 50% off on all brands</p>
<a href="products.html"><input type="button" class="btn btn-danger btn-lg active" value="Shop Now"></a>
</div>
</center>
</div>
</div>
解决方案
利用:
background-image: url("http://test.puurmondhygienist.nl/wp-content/uploads/2017/01/slide_bg_2400x1080.jpg");
我认为它可以与 background-image 属性一起使用。不仅是背景。我为 URL 加上引号。然后我删除no-repeat center center
并结束代码
推荐阅读
- spring - 为单个 Spring Boot 实例配置多个模板解析器
- java - 自动发送电子邮件
- angular6 - angular 6 通用问题“未找到模块:错误:无法解析“/var/www/html/angular6/testing”中的“./dist/server/main”
- javascript - 通过 ajax 请求观察 div 突变
- javascript - Jquery .load 用于烧瓶\python 上的更新片段
- c# - 通过 EF6 在方法链接上获取生成的 sql
- react-native - 排毒(Android):device.reloadReactNative 失败
- c# - 在 Dynamics 365 中正确创建 SalesOrder
- delphi - 带有图像的 TPopupMenu 中闪烁的 TMenuItem
- excel - 在排序宏中使用 VBA 函数