jquery - 图像相乘
问题描述
我试图让我的网站响应,但是当我拖动寡妇查看结果时,背景只是成倍增加。我有 2 张图片作为背景(1 张在开头,1 张在底部)
我试过了
@media screen and (max-width : 1600px) {
.bg1{
background-size: 100%;
background-repeat: no-repeat;
}
}
如果我这样做,我会在图像之间得到一些空间。
HTML:
<div class="bg1">
*some content here*
</div>
CSS:
@media screen and (max-width : 1600px) {
.titlu h1{ font-size: 20rem; }
.navbar li a{
font-size: 20px;
}
.bg1{
background-size: 100%;
background-repeat: no-repeat;
}
}
解决方案
您可以使用background-position
来放置图像并background-repeat
避免重复
@media screen and (max-width : 1600px) {
.bg1 {
background-size: 100%;
background-position: center;
background-repeat: no-repeat;
}
}
推荐阅读
- android-studio - 为什么在 android studio 更新后出现“manifestOutputDirectory”错误?
- python - Python - PySimpleGUI - 无法选择日历输入
- java - 我有这个错误:“无法将 java.lang.String 类型的对象转换为 com.flashpub.flash.imageSection 类型”,我不知道为什么
- javascript - 如何使用 Electron.js 彼此相邻显示自定义 Windows 消息框按钮
- android - 我怎样才能在android中制作一个完美的正方形?
- ios - 如何在运行时更改 UIMenu 内的 UIAction 的状态?
- c++ - 在 Xcode C-lang 中链接库
- javascript - 为什么我的应用脚本代码将电子表格复制到谷歌驱动器的根目录以及特定目录?
- docker - Dockerfile:来自守护进程的错误响应:OCI 运行时创建失败:container_linux.go:349
- java - 在方法重载中,方法解析发生在编译时还是运行时?