css画一条渐变色的直线

通过div   画渐变色的直线

左右方向渐变【调整方向:改变第一个参数:lef、right、top、bottom】

 

#grad { 
    background: -webkit-linear-gradient(right, white,#00FF0A); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(right, white,#00FF0A); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(right,white,#00FF0A); /* Firefox 3.6 - 15 */
    background: linear-gradient(to right, white,#00FF0A); /* 标准的语法(必须放在最后) */
    height: 6px; 
} 


<div id="grad"></div> 

 

效果图:

 

posted @ 2020-11-16 11:52  逸凨  阅读(1029)  评论(0编辑  收藏  举报