快速提问:
您将如何在 CSS 中对径向渐变进行样式化以实现此效果?
谢谢!
jsfiddle 链接:JsFiddle
html代码:
<div class="gradient">
</div>
CSS代码:
.gradient{ height:79px;
width:298px;
background: #7ddbfb; /* Old browsers */
background: -moz-radial-gradient(center, ellipse cover, #7ddbfb 46%, #56bdf4 100%); /* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(46%,#7ddbfb), color-stop(100%,#56bdf4)); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, #7ddbfb 46%,#56bdf4 100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, #7ddbfb 46%,#56bdf4 100%); /* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover, #7ddbfb 46%,#56bdf4 100%); /* IE10+ */
background: radial-gradient(ellipse at center, #7ddbfb 46%,#56bdf4 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#7ddbfb', endColorstr='#56bdf4',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */
-webkit-border-radius: 20px;
-moz-border-radius: 20px;
border-radius: 20px;
}
您可以尝试在此处制作渐变