How to add multiple css gradient as a multiple background?

断了今生、忘了曾经 提交于 2019-12-17 18:56:50

问题


I want to make a button like this without using image by gradients as multiple background. is it possible?

using single element

<span class="customStyleSelectBox">Dummy Text</span>

Try at jsfiddle here http://jsfiddle.net/Awf6s/2/


回答1:


You can define multiple gradients comma-separated. E.g.:

.customStyleSelectBox {
    ...
    background: linear-gradient(#fff, #999) no-repeat border-box, linear-gradient(#eee, #777) no-repeat border-box;
    background-size: 98px 50px, 18px 50px;
    background-position: 0 0, 98px 0;
    background-origin: padding-box, padding-box;
}

Also see your updated jsfiddle.



来源:https://stackoverflow.com/questions/8253452/how-to-add-multiple-css-gradient-as-a-multiple-background

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!