访问过的链接颜色变化

jcs*_*lzr 1 html css php

我有这门课:

.news_item_info 
{
    font-size: .7em; 
    color:#000000; 
    text-indent: 30px;
    a:link { color: #000000; }
    a:visited { color: #000000; }   
}
Run Code Online (Sandbox Code Playgroud)

这里有代码:

<div class="news_item_info">
    <?php echo $articles[$index]->getPoints(); ?> puntos por <span class="news_item_user"><a href="/index.php?action=user&param=<?php echo $articles[$index]->getUsername(); ?>">
    <?php echo $articles[$index]->getUsername(); ?></a> </span>
    <?php echo $articles[$index]->getElapsedDateTime(); ?> | <span class="comments_count"><a href="<?php echo "/index.php?action=comments&param=".$articles[$index]->getId(); ?>"><?php echo $articles[$index]->getNumberOfComments($articles[$index]->getId()); ?> comentarios</a></span>
</div>
Run Code Online (Sandbox Code Playgroud)

问题是,在我访问用户配置文件后,它显示为灰色,我想保持黑色.

如果有人知道答案我会很感激.

Qui*_*son 14

发布的CSS无效,您必须通过级联定义来限定样式.尝试取消嵌套链接定义,如下所示:

.news_item_info 
{
    font-size: .7em; 
    color:#000000; 
    text-indent: 30px;       
}

.news_item_info a:link { color: #000000; }
.news_item_info a:visited { color: #000000; }
Run Code Online (Sandbox Code Playgroud)