如何在CSS中使用repeat-x值完成每个重复背景图像后消除白色垂直描边?
不太确定为什么会发生这种情况,但如果我将身体背景图像设置为重复 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
问题出在您的源图像上。如果仔细观察,其中有第二个渐变(从上到下以及从左到右):
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:
你的图像渐变左侧更白,右侧更暗,
使用 1px 宽度的背景图像来纠正此错误:
ur image gradient more white al left and more dark at right
use 1px width background image to correct this mistake: