html - 居中多个背景
问题描述
在我的网站上,我有 3 张图片构成完整的背景,宽度均为 1920 像素。顶部不重复,中心重复-y,底部不重复。
但看起来中心图像相对于其他图像分散了 1 个像素。如果我删除中心 bg,顶部和底部保持对齐。
body.myclass {
width: 100%;
background: url(../images/top-fon-bg2.jpg) top center no-repeat, url(../images/bottom-fon-bg2.jpg) bottom center no-repeat, url(../images/fon-repeat2.jpg) center repeat-y;
background-color: #000000;
font-family: Tahoma, Arial, sans-serif;
font-size: 12px;
color: #7d7d7d;
line-height: 1;
min-height: 100vh;
}
结果:
解决方案
推荐阅读
- javascript - 如何从firestore中的文档ID数组中获取所有子集合文档
- c++ - 有什么方法可以用 C++ 打印我的上标多项式指数?
- visual-studio - 将文件复制到输出目录到另一个项目的输出目录
- python - Discord bot python-在文本文件中写入和日志记录
- php - 使用 Content-Type 调用 api 时出现问题:application/json (lumen/react fetch)
- excel - 以逗号分隔的多个数据到不同的列
- html - 垂直对齐(Flexbox)和中心对齐有问题
- html - 如何将使用 html/css 制作的模态添加到我的引导网站?
- reactjs - 如何使用mapbox在同一图层中绘制多个不同颜色的点?
- tensorflow - 训练对象检测模型时,张量板图像选项卡上没有显示边界框是否正常?