见图:
灰色区域实际上是一个图像。
如何使用css3找到最接近的颜色来创建相似的颜色?
我发现以下颜色最接近,但不确定它们是否匹配,因为我不知道如何在CSS3中使用它们:
5A5757 - 顶部
585555 - 底部
答案 0 :(得分:3)
将此代码放入您的css并设置身高。
background: #5a5757; /* Old browsers */
background: -moz-linear-gradient(top, #5a5757 0%, #5a5757 15%, #2b4244 15%, #2b4244 31%, #585555 31%, #585555 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#5a5757), color-stop(15%,#5a5757), color-stop(15%,#2b4244), color-stop(31%,#2b4244), color-stop(31%,#585555), color-stop(100%,#585555)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top, #5a5757 0%,#5a5757 15%,#2b4244 15%,#2b4244 31%,#585555 31%,#585555 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top, #5a5757 0%,#5a5757 15%,#2b4244 15%,#2b4244 31%,#585555 31%,#585555 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top, #5a5757 0%,#5a5757 15%,#2b4244 15%,#2b4244 31%,#585555 31%,#585555 100%); /* IE10+ */
background: linear-gradient(to bottom, #5a5757 0%,#5a5757 15%,#2b4244 15%,#2b4244 31%,#585555 31%,#585555 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#5a5757', endColorstr='#585555',GradientType=0 ); /* IE6-9 */