我的样式表中有CSS渐变。我遇到的问题是颜色从#FFFFFF变为#EBEBEB,但是当页面上有很多内容并且您必须向下滚动渐变时,它会重复自身,而页面应向下延伸的地方。下面是代码:body { /* Safari 4-5, Chrome 1-9 */ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#FFFFFF), to(#EBEBEB)); /* Safari 5.1, Chrome 10+ */ background: -webkit-linear-gradient(top, #FFFFFF, #EBEBEB); /* Firefox 3.6+ */ background: -moz-linear-gradient(top, #FFFFFF, #EBEBEB); /* IE 10 */ background: -ms-linear-gradient(top, #FFFFFF, #EBEBEB); /* Opera 11.10+ */ background: -o-linear-gradient(top, #FFFFFF, #EBEBEB);}谁能帮我。谢谢。 最佳答案 也许这会有所帮助:no-repeathtml { background-color: #EBEBEB;}body { /* fallback */ background-color: #EBEBEB; /* Safari 4-5, Chrome 1-9 */ background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#FFFFFF), to(#EBEBEB)) no-repeat; /* Safari 5.1, Chrome 10+ */ background: -webkit-linear-gradient(top, #FFFFFF, #EBEBEB) no-repeat; /* Firefox 3.6+ */ background: -moz-linear-gradient(top, #FFFFFF, #EBEBEB) no-repeat; /* IE 10 */ background: -ms-linear-gradient(top, #FFFFFF, #EBEBEB) no-repeat; /* Opera 11.10+ */ background: -o-linear-gradient(top, #FFFFFF, #EBEBEB) no-repeat;}​关于html - CSS渐变停止并重复,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/9646355/
10-13 00:16