我有這些樣式爲全球所有我的鏈接。我無法覆蓋同一頁面上的div中的鏈接樣式。我剛剛發現了CSS中的錯誤,或者我忽略了一些東西?
a, a:visited{
outline: 0;
cursor: pointer;
color: inherit;
text-decoration: none;
}
a:hover{
text-decoration: underline;
}
現在我要重寫錨鏈接樣式,以將其顏色改爲白色懸停,但只有在多類這樣一個看不見的通知容器的一個div ...
<div class="unseen notificationContainer">
<a href="profile?customerId=1365764036258">
<strong>robert</strong>
</a>
sent you a friend request
<a href="friend_request?type=accept&notificationId=1365764054463">
Accept
</a>
<a href="friend_request?type=reject&notificationId=1365764054463">
Reject
</a>
</div>
所以我添加下面我CSS
.unseen{
background: #09f;
color: #fff;
}
.unseen a :hover{
color: #fff;
text-decoration: underline;
}
頁面加載徘徊第一個鏈接讓改變其顏色爲白色,但其他三個取背景的顏色爲藍色。過去一個小時我一直在這裏,而不是隻是令人煩惱。通知容器的樣式如下
.notificationContainer{
width: 390px;
float: left;
border-bottom: solid 1px #eee;
padding: 5px;
}
在此先感謝。
考慮編輯問題的標題更具體的實際問題 – davidb