Javascript 如何设置文本框的按钮渐变颜色?

Javascript 如何设置文本框的按钮渐变颜色?,javascript,html,css,Javascript,Html,Css,我想设计一个文本框和文本区域,里面有一些渐变效果,看起来像上面的img 我想办法把它按在按钮上 但我无法将其固定到文本区域 #gradient { background: -webkit-gradient(linear, center top, center bottom, color-stop(0%, #ccc), color-stop(100%, #fff)); background: -moz-linear-gradient(top, #ccc, #fff); } 使用#gran

我想设计一个文本框和文本区域,里面有一些渐变效果,看起来像上面的img

我想办法把它按在按钮上

但我无法将其固定到文本区域

#gradient {
  background: -webkit-gradient(linear, center top, center bottom, color-stop(0%, #ccc), color-stop(100%, #fff));
  background: -moz-linear-gradient(top, #ccc, #fff);
}
使用
#grandient
作为输入框的id

使用此选项生成渐变:

编辑:比我快

​textarea {
    background: rgb(255, 255, 255);
    background: -moz-linear-gradient(270deg, rgb(255, 255, 255) 75%, rgb(230, 230, 230) 100%);
    background: -webkit-linear-gradient(270deg, rgb(255, 255, 255) 75%, rgb(230, 230, 230) 100%);
    background: -o-linear-gradient(270deg, rgb(255, 255, 255) 75%, rgb(230, 230, 230) 100%);
    background: -ms-linear-gradient(270deg, rgb(255, 255, 255) 75%, rgb(230, 230, 230) 100%);
    background: linear-gradient(270deg, rgb(255, 255, 255) 75%, rgb(230, 230, 230) 100%);
}​
Exmpl-


要了解更多css3生成器-

请尝试以下方法:[注意:根据需要调整颜色]

css:

html


您可以检查此项或。这将满足你的需要

因此,您没有插入css和html。我们可以做到这一点

如果需要代码,请使用以下代码


请附上你的CSS和HTML的例子。我只需要文本区域背景的CSS。我会在几分钟内上传我的CSS。我删除了我以前的一个,但没有例子,我的答案是它应该适用于两个Cellent。这样回答使stackoverflow成为最好的。经过一个小时的努力,我得到了解决办法:)
​textarea {
    background: rgb(255, 255, 255);
    background: -moz-linear-gradient(270deg, rgb(255, 255, 255) 75%, rgb(230, 230, 230) 100%);
    background: -webkit-linear-gradient(270deg, rgb(255, 255, 255) 75%, rgb(230, 230, 230) 100%);
    background: -o-linear-gradient(270deg, rgb(255, 255, 255) 75%, rgb(230, 230, 230) 100%);
    background: -ms-linear-gradient(270deg, rgb(255, 255, 255) 75%, rgb(230, 230, 230) 100%);
    background: linear-gradient(270deg, rgb(255, 255, 255) 75%, rgb(230, 230, 230) 100%);
}​
#gradientTextarea  {
 background: -moz-linear-gradient(top, #ffffff 0%, #f5f5f5 100%); / FF3.6+ /
 background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff),  color-stop(100%,#f5f5f5)); / Chrome,Safari4+ /
 background: -webkit-linear-gradient(top, #ffffff 0%,#f5f5f5 100%); / Chrome10+,Safari5.1+ /
 background: -o-linear-gradient(top, #ffffff 0%,#f5f5f5 100%); / Opera 11.10+ /
 background: -ms-linear-gradient(top, #ffffff 0%,#f5f5f5 100%); / IE10+ /
 background: linear-gradient(to bottom, #ffffff 0%,#f5f5f5 100%); / W3C /
 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#f5f5f5',GradientType=0 );
 border:1px solid #f5f5f5;
}   
<textarea id="gradientTextarea"></textarea>
 .gradient_effect{
 background: rgb(252,255,244); /* Old browsers */
 background: -moz-linear-gradient(top,  rgba(252,255,244,1) 0%, rgba(223,229,215,1)     40%, rgba(179,190,173,1) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(252,255,244,1)), color-stop(40%,rgba(223,229,215,1)), color-stop(100%,rgba(179,190,173,1))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(top,  rgba(252,255,244,1) 0%,rgba(223,229,215,1) 40%,rgba(179,190,173,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(top,  rgba(252,255,244,1) 0%,rgba(223,229,215,1) 40%,rgba(179,190,173,1) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(top,  rgba(252,255,244,1) 0%,rgba(223,229,215,1) 40%,rgba(179,190,173,1) 100%); /* IE10+ */
background: linear-gradient(to bottom,  rgba(252,255,244,1) 0%,rgba(223,229,215,1) 40%,rgba(179,190,173,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfff4', endColorstr='#b3bead',GradientType=0 ); /* IE6-9 */
.text_box-border:double 5px #000000;
-moz-border-radius-topleft: 8px;
 -moz-border-radius-topright:8px; 
-moz-border-radius-bottomleft:8px;
-moz-border-radius-bottomright:8px; 
-webkit-border-top-left-radius:8px;
-webkit-border-top-right-radius:8px; 
-webkit-border-bottom-left-radius:8px;
-webkit-border-bottom-right-radius:8px;
border-top-left-radius:8px;
border-top-right-radius:8px; 
border-bottom-left-radius:8px;
border-bottom-right-radius:8px;
 -moz-box-shadow: 10px 10px 5px #8c898c;
-webkit-box-shadow: 10px 10px 5px #8c898c;
box-shadow: 10px 10px 5px #8c898c;
}