About CSS3 background gradient color invalidity

Invalid css [linear-gradient] wording

.loginbox{
    background-color: linear-gradient(#D0D0D0, #E0E0E0, white); 
    width: 300px;
}
  • This CSS style can not change the background color of the element, because the gradient is defined in the CSS became a type, so the gradient can only be used where it is needed graphics data. Therefore linear-gradient invalid references, in order to achieve operation can be written directly in the background property background-color and color in
.loginbox{
    background: linear-gradient(#D0D0D0, #E0E0E0, white); 
    width: 300px;
}
  • If still can not be displayed, consider browser compatibility issues
    background: -webkit-linear-gradient(red, blue); /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(red, blue); /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(red, blue); /* Firefox 3.6 - 15 */
    background: linear-gradient(red, blue); /* 标准的语法(必须放在最后) */

Unfinished, continued

Guess you like

Origin www.cnblogs.com/jjxhp/p/11669500.html