2016-09-18 66 views
0

您好我想渐变色添加到我的div的背景.. 我想这个代码,但它不工作如何渐变颜色添加到背景DIV

#apple { 
 
    background: #0E5D7B; 
 
    /* For browsers that do not support gradients */ 
 
    background: -webkit-linear-gradient(white, #0E5D7B); 
 
    /* For Safari 5.1 to 6.0 */ 
 
    background: -o-linear-gradient(white, #0E5D7B); 
 
    /* For Opera 11.1 to 12.0 */ 
 
    background: -moz-linear-gradient(white, #0E5D7B); 
 
    /* For Firefox 3.6 to 15 */ 
 
    background: linear-gradient(white, #0E5D7B); 
 
    /* Standard syntax */ 
 
}
<div id="apple" style="height: 300px;width:auto;background-color: \t #0E5D7B; margin-top: 0px;"> 
 
</div>

请告诉我如何解决这个问题

+3

看起来做工精致......什么问题? – kukkuz

+0

同意,这有效,所以什么不适合你? – LGSon

回答

-1

只是fyi,你错过了类选择器(一个点)。对于一个班级,你使用一个点,#为一个ID。希望这有助于

+0

代码中没有课程:O –

+0

忽略此我厌倦并误读。 –

0

#apple{ 
    height: 300px; 
    width:auto; 
    background-color:#0E5D7B; 
    margin-top: 0px; 
    background:linear-gradient(white, lightblue); 
} 

<div id="apple"> 
</div>