如何在CSS中使用repeat-x值完成每个重复背景图像后消除白色垂直描边?

发布于 2024-12-16 20:24:23 字数 275 浏览 3 评论 0原文

不太确定为什么会发生这种情况,但如果我将身体背景图像设置为重复 x 的值,它会很好地重复,但会在每个重复图像后添加此白色描边。有人能告诉我这是为什么吗?我以前从未遇到过这种情况。下面你可以看到我的 CSS。

body {
font-family: Verdana, Helvetica;
margin: 0;
padding: 0;
background: url("themes/base/images/tausta2.png") repeat-x;
color: black;
}

Not really sure why this happens, but if I set my body background image a value of repeat-x, it repeats fine, but adds this white stroke after every repeated image. Can someone tell me why this is? I have never come across this before. Below you can see my CSS.

body {
font-family: Verdana, Helvetica;
margin: 0;
padding: 0;
background: url("themes/base/images/tausta2.png") repeat-x;
color: black;
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

预谋 2024-12-23 20:24:23

问题出在您的源图像上。如果仔细观察,其中有第二个渐变(从上到下以及从左到右):

gradient

The problem is with your source image. This has a second gradient (top-bottom as well as left-right) in it, if you look closely:

gradient

随波逐流 2024-12-23 20:24:23

在此处输入图像描述

你的图像渐变左侧更白,右侧更暗,

使用 1px 宽度的背景图像来纠正此错误:

在此处输入图像描述

enter image description here

ur image gradient more white al left and more dark at right

use 1px width background image to correct this mistake:

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文