简体   繁体   English

在CSS中使用repeat-x值完成的每个重复背景图像之后,如何摆脱白色垂直笔划?

[英]How to get rid of the white vertical stroke after every repeating background image done with repeat-x value in CSS?

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. 不太确定为什么会发生这种情况,但是如果我将身体背景图像设置为repeat-x的值,它会很好地重复,但是会在每个重复的图像之后添加此白色笔触。 Can someone tell me why this is? 有人可以告诉我为什么吗? I have never come across this before. 我以前从未遇到过。 Below you can see my CSS. 在下面,您可以看到我的CSS。

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

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: 如果您仔细观察的话,其中还有第二个渐变(上下左右):

梯度

在此处输入图片说明

ur image gradient more white al left and more dark at right ur图像渐变,左侧更白,右侧更暗

use 1px width background image to correct this mistake: 使用1px宽的背景图片来纠正此错误:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM