css3实现背景颜色渐变,文字颜色渐变,边框颜色渐变
css3的渐变可以使用2个或者多个指定的颜色之间显示平稳的过渡的效果。这篇文章主要介绍下css3实现背景颜色渐变,文字颜色渐变,边框颜色渐变的方法,以便大家学习参考!
1、css背景颜色渐变
代码:
<style> .content_bg{ width:600px;max-width: 100%;margin: auto; height:150px; line-height:150px; text-align:center; font-size:32px;color:#fff; background-image:linear-gradient(left, #eef2be,#f2441f); background-image:-webkit-linear-gradient(left, #eef2be,#f2441f); background-image:-moz-linear-gradient(left, #eef2be,#f2441f); background-image:-o-linear-gradient(left, #eef2be,#f2441f); background-image:linear-gradient(left, #eef2be,#f2441f); } </style> <div class="content_bg">css背景颜色渐变</div>
效果:
css背景颜色渐变
2、文字颜色渐变
代码:
<style> .content_txt { width:600px;max-width: 100%;margin: auto; height:150px; line-height:150px; text-align:center; font-size:32px; background-image:-webkit-linear-gradient(left, #eef2be,#f2441f); background-image:-moz-linear-gradient(left, #eef2be,#f2441f); background-image:-o-linear-gradient(left, #eef2be,#f2441f); background-image:linear-gradient(left, #eef2be,#f2441f); -webkit-background-clip:text; -webkit-text-fill-color:transparent; } </style> <div class="content_txt">css文字颜色渐变</div>
效果:
css文字颜色渐变
3、边框颜色渐变
代码:
.content_border { width:600px;max-width: 100%;margin: auto; height:150px; line-height:150px; text-align:center; font-size:32px;color:#888; border: 10px solid; border-image: -webkit-linear-gradient(#eef2be,#f2441f) 30 30; border-image: -moz-linear-gradient(#eef2be,#f2441f) 30 30; border-image: linear-gradient(#eef2be,#f2441f) 30 30; } </style> <div class="content_border">css边框颜色渐变</div>
资源网站大全 https://55wd.com 设计导航https://www.wode007.com/favorites/sjdh
效果:
css边框颜色渐变
相关推荐
myloveqiqi 2020-08-09
猫沙盆 2020-07-08
猫沙盆 2020-07-07
SuiKaSan的自学室 2020-06-13
福叔 2020-06-02
CaiKanXP 2020-06-02
opspider 2020-05-29
jiedinghui 2020-05-14
wcssdu 2020-05-11
somboy 2020-04-19
zengni 2020-04-16
somboy 2020-02-23
jiedinghui 2020-02-20
MaureenChen 2020-02-17
cfang00 2013-05-15
impress 2020-01-11