jcslzr
jcslzr

Reputation: 435

Visited link color changes

I have this class:

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

Here its with code:

<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>

The problem is that after I visit the user profile it shows as gray and I want to keep the black color.

If anyone knows the answer I will appreciate it.

Upvotes: 1

Views: 2742

Answers (2)

ceejayoz
ceejayoz

Reputation: 180176

You can't do CSS like that (nested blocks).

.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; }       

Upvotes: 4

Quintin Robinson
Quintin Robinson

Reputation: 82375

The CSS posted is invalid, you have to qualify the styles by cascading definition. Try un-nesting your link definitions like so:

.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; }

Upvotes: 14

Related Questions