2013-08-27 127 views
0

我真的覺得這個問題很愚蠢,因爲它應該是一個真正的基本知識,樣式鏈接與CSS。 而今天,我一直在嘗試設計一個沒有成功的鏈接,樣式表不希望應用到我想要的鏈接上。 這是樣式表公開發行A:鏈接造型不適用於鏈接由於某種原因

A:link {text-decoration: none; color: white;} 
A:visited {text-decoration: none; color: white;} 
A:active {text-decoration: none; color: white;} 
A:hover {text-decoration: underline; color: red;} 

這是如果代碼中,我想獲得它的工作(這是在一個while循環查詢數據庫)

$query=$db->prepare("SELECT post_id, title, body, category FROM posts INNER JOIN categories ON categories.category_id=posts.category_id ORDER BY post_id DESC"); 
    $query->execute(); 
    $query->bind_result($post_id, $title, $body, $category);  
while($query->fetch()):?> 
    <?php $lastspace = strrpos($body, ' ');?> 
    <article> 
    <h2><?php echo $title?></h2> 
    <?php echo $category;?> 
    <?php echo "<hr>";?> 
    <p><?php echo nl2br (substr($body,0,$lastspace)). "<a href='post.php?id=$post_id'>Read More</a>"?></p> 
    <?php echo "<hr>"?> 
    </article> 
    <?php endwhile ?> 

好塊,這就是它。我做錯了什麼/如何解決這個問題?

+3

發佈呈現的HTML,而不是PHP。 – j08691

+0

作爲一種習慣,我會寫一個:鏈接而不是A:鏈接。但是,是的,張貼代碼的一部分,那裏是整合的CSS。 – ffarquet

+2

可能會有另一個CSS選擇器具有更高的特異性,覆蓋此選項。沒有看到整個頁面不能分辨。 – andi

回答

0

清除緩存工作。我以前應該想到這一點。