2016-06-22 32 views
0

更改文本顏色我與folloing這段代碼的PHP文件:WordPress的:需要從PHP文件

<div class="post hentry ivycat-post"> 
<!-- This is the output of the post TITLE --> 
<h2 class="entry-title"> 
    <a href="<?php the_permalink(); ?>"><?php the_title(); ?> <------Click Here </a> 
</h2> 

我需要的是改變,上面寫着「點擊這裏」文本的顏色。我在wordpress中構建網站,並且通過其他選項無法通過CSS更改文本顏色。

謝謝。

+0

爲什麼你不能用CSS改變呢? – Frutis

+0

你可以改變你的樣式表......或醜陋但很簡單:在你的''標籤上加'style =「color:#00ff00;'' –

回答

0

歡迎堆棧溢出@BodyvolutiomGym :-)

請搜索棧溢出,看是否問題已經回答了,以避免讓你的問題下來投了反對票。

只是將要更改顏色的文本換成<span>並將color設置爲style屬性。

<span style="color:red">Click Here</span> 

整個代碼看起來像這樣...

<div class="post hentry ivycat-post"> 
<!-- This is the output of the post TITLE --> 
<h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?> <------<span style="color:red">Click Here</span> </a></h2> 
0

您應該能夠通過使用CSS選擇器a:link改變顏色。

a:link { 
    color: red; 
} 

雖然這會影響整個網站。您可以通過使用類或ID來限制單個鏈接的效果。

/* This will only affect links with class "nice" */ 
a.nice:link { 
    color: green; 
} 

/* This will only affect a single link (as IDs must be unique) with ID "awesome" */ 
a#awesome:link { 
    color: gray; 
} 
0

CSS

.ivycat-post h2.entry-title a{color:#DDD;} 
0

請使用像thsis

<div class="post hentry ivycat-post"> 
<!-- This is the output of the post TITLE --> 
<h2 class="entry-title"> 
    <a href="<?php the_permalink(); ?>"><?php the_title(); ?> <------<span style="color:red">Click Here</span> </a> 
</h2>