0
div.browseBuildsArea-pro  a:active, a:visited, a:link { 
    text-decoration: none; 
    color: #dddddd; 
    background-color: rgba(0, 0, 0, 0.3); 
    padding: 10px; 
}

div.browseBuildsArea-pro  a:hover {
    text-decoration: none; 
    color: #dddddd; 
    background-color: rgba(0, 0, 0, 0.9); padding: 10px;
}

Links are like this:

<div class="browseBuildsArea-pro">
<div class="build-poster">
    <div class="inner">
        <a href="#">Test</a>
    </div>
</div>
</div>

The problem is, the CSS attributes above applies to all a tags in website. This A class should only work under browseBuildsArea-pro class of div.

Any thoughts?

4

1 回答 1

3

也许试试这个:

div.browseBuildsArea-pro  A:active, 
div.browseBuildsArea-pro  A:visited, 
div.browseBuildsArea-pro  A:link { 
    text-decoration: none; 
    color: #dddddd; 
    background-color: rgba(0, 0, 0, 0.3); 
    padding: 10px; 
}

div.browseBuildsArea-pro不会自动超过逗号。

于 2013-02-02T12:47:56.587 回答