2014-09-25 66 views
0

我試圖添加transition:1s;並將文本過渡到color:#0000。在我的圖片下,我的圖片標題中的文字是'Joe Doe'。我嘗試了在我的CSS中的幾個地方,但沒有任何工作。我在我的WordPress網站http://boasish.com/ios-8/如何向圖像標題中的文本添加過渡

<p class="wp-caption-text">Image: 
    <a href="http://mashable.com/2014/09/25/disney-characters-halloween-costumes/" onclick="ga('send', 'event', 'outbound-article', 
    'http://mashable.com/2014/09/25/disney-characters-halloween-costumes/', 'Joe Doe');" target="_blank">Joe Doe 
    </a> 
</p> 

使用創世紀Framwork與TRU千年主題這是我嘗試在其他幾件事情:

a { 
text-decoration: none; 
color: #8B8080; 
} 

a:hover { 
transition: 1s; 
color: #0000 
} 
+1

我想你的意思是要麼#000或#000000 – 2014-09-25 16:11:15

回答

0

a { 
 
text-decoration: none; 
 
color: #8B8080; 
 
\t transition:color 1s; 
 
} 
 
a:hover { 
 
color: #000000; 
 
}
<a href="http://mashable.com/2014/09/25/disney-characters-halloween-costumes/" onclick="ga('send', 'event', 'outbound-article', 
 
    'http://mashable.com/2014/09/25/disney-characters-halloween-costumes/', 'Joe Doe');" target="_blank">Joe Doe 
 
    </a>

1

:hover顏色的十六進制代碼無效。它應該是3或6位數字。

MDN Color docs成員國表示RGB十六進制值的方法有兩種:

對於較大的調色板,通過使用數字符號(散)指定想要的顏色的紅色,綠色和藍色分量和三個十六進制數字在範圍0 - 9中,a - f。字母A - F表示值10 - 15:
實例:#000

對於全調色板,指定兩個十六進制數字的每個組件:
實例:#000000

a { 
 
text-decoration: none; 
 
color: #8B8080; 
 
} 
 

 
a:hover { 
 
transition: 1s; 
 
color: #000000 
 
}
<a href="http://mashable.com/2014/09/25/disney-characters-halloween-costumes/" onclick="ga('send', 'event', 'outbound-article', 
 
    'http://mashable.com/2014/09/25/disney-characters-halloween-costumes/', 'Joe Doe');" target="_blank">Joe Doe 
 
    </a>

+0

確定不承認謝謝你,但我怎麼得到它'轉變:從1s''顏色:#8B8080'爲'顏色:#000000' – 2014-09-25 16:14:01

+0

它已經是(見snippet)。但是如果你想讓它淡入淡出,可以將'transition'屬性設置爲主規則,而不是':hover'一個 – LcSalazar 2014-09-25 16:16:51

+0

請問這個downvoter請解釋這個答案有什麼問題? – LcSalazar 2014-09-25 16:17:42

相關問題