2016-07-28 12 views
0

Wie erben kann ich erben von a: link, a: visited a: aktiv .menunav: schwebenWie Klassenwerte in CSS

I-Code haben wie diese

a:link, a:visited, a:active { 
    color: white !important; 
    text-decoration: none !important; 
} 

.menunav:hover { 
    color: white !important; 
    text-decoration: none !important; 
    background: #333; 
    transition-duration: 0.5s; 
} 

ich will erben

color: white !important; text-decoration: none !important;

Antwort

0

Um diese Eigenschaften in der zweiten Elementtyp haben, können Sie entweder copy-Paste, die Eigenschaften in die zweite Regel, wie Sie oben haben, oder den Wähler appe haben ar in beiden Regeln.

a:link, a:visited, a:active, .menunav:hover { 
    color: white !important; 
    text-decoration: none !important; 
} 

.menunav:hover { 
    background: #333; 
    transition-duration: 0.5s; 
} 
0
a.menunav:hover, 
a.menunav:link, 
a.menunav:visited, 
a.menunav:active { 
    color: white !important; 
    text-decoration: none !important; 
}