2012-06-24 56 views
1

我試過多次應用於下面的一段代碼,CSS文件中不工作:-webkit-線性漸變在Dreamweaver CS6

display: block; 
width: 500px; 
margin: 500px auto; 
padding: 15px; 
text-align: center; 
border: 4px solid blue; 
background: -webkit-linear-gradient(top,black,white); 
outline: 7px solid red; 

一切都正確顯示,除了梯度。我打開了CS6 Live View,但它仍然拒絕出現。我所有的東西都是白色背景,而不是黑白漸變。但是,當我將相同的代碼行輸入到我下載的Coda 2的試用版中時,它完美地工作。我能做些什麼來解決這個問題嗎?

+0

什麼關於Internet Explorer? –

+0

我沒有在IE上測試它。我使用的是DW的Live View功能。其他一切工作正常,除了漸變。 –

+1

你爲什麼使用DW的即時取景?請記住,它不是一個真正的瀏覽器。我建議您查看LiveReload和Adobe Shadow以幫助您完成工作。一旦你意識到自己有多棒,試試崇高的文字2 ... –

回答

1

試試這個:

background-image: linear-gradient(top, rgb(0,0,0) 0%, rgb(255,255,255) 100%); 
background-image: -o-linear-gradient(top, rgb(0,0,0) 0%, rgb(255,255,255) 100%); 
background-image: -moz-linear-gradient(top, rgb(0,0,0) 0%, rgb(255,255,255) 100%); 
background-image: -webkit-linear-gradient(top, rgb(0,0,0) 0%, rgb(255,255,255) 100%); 
background-image: -ms-linear-gradient(top, rgb(0,0,0) 0%, rgb(255,255,255) 100%); 

background-image: -webkit-gradient(
    linear, 
    left top, 
    left bottom, 
    color-stop(0, rgb(0,0,0)), 
    color-stop(1, rgb(255,255,255)) 
); 

來自:http://gradients.glrzad.com/