css - 我想在 css 中增加背景的宽度,我该怎么做?
问题描述
如何增加我的背景宽度
下面给出的是我的代码。
#introSection {
color: white;
background: center / contain no-repeat url("/static/bg.jpg");
height: 300px;
background-color: red;
}
解决方案
为了使basckgroudcover
成为div,只需将行更改为:
background: center / cover no-repeat url("/static/bg.jpg");
有关调整背景大小的各种选项的更多信息,请参阅MDN 。
推荐阅读
- python - 使用python收到错误后如何继续请求库功能?
- python - 如何在python中显示文件内容
- python - 我正在尝试在 seaborn 的对数图上绘制两个数据特征。如何为这种相关性拟合一条线?
- javascript - 在嵌套对象内排序
- c++ - 调用排序没有匹配的函数
- azure-devops - 使用 Visual Studio 测试任务并行运行测试失败
- python - 在 TKinter 窗口中嵌入 pyplot
- xamarin.forms - Xamarin 项目警告:使用 .NETFramework(...) 而不是项目目标框架恢复包 Microsoft.Net.Http 2.2.29
- docker - docker 容器是基于云的吗?
- python - 如何在 pyspark udf 执行器中导入 django rest 框架 api?