2016-05-25 156 views

回答

0

只需使用漸變的CSS規則?

#grad { 
 
    background: linear-gradient(black, white); /* Standard syntax */ 
 
} 
 

 
#grad2 { 
 
    background: red; /* For browsers that do not support gradients */ 
 
    background: -webkit-linear-gradient(red, yellow, green); /* For Safari 5.1 to 6.0 */ 
 
    background: -o-linear-gradient(red, yellow, green); /* For Opera 11.1 to 12.0 */ 
 
    background: -moz-linear-gradient(red, yellow, green); /* For Firefox 3.6 to 15 */ 
 
    background: linear-gradient(red, yellow, green); /* Standard syntax */ 
 
}
<div id="grad"> 
 
    <br><br> 
 
</div> 
 

 
<div id="grad2"> 
 
    <br><br> 
 
</div>

一些閱讀:CSS Gradients