我有一個帶有加號字體的可愛疊加圖像。當我將鼠標懸停在圖片上(標籤)時,我想顯示加號,但我不確定是否有正確的CSS。當我將鼠標懸停在它上面時,加號不顯示!懸停在父元素上以顯示覆蓋的子元素
這裏是我的代碼
a.registerTeacherAsHost:hover {
cursor: pointer !important;
opacity: 0.4;
}
a.registerTeacherAsHost:hover > .addTeacher {
display: normal;
}
<a class="registerTeacherAsHost" [email protected]>
<div class="thumbnail">
<div>
<img class="img-responsive" src="~/Images/User_small_compressed_blue.png" style="position: relative; left: 0; top: 0;" alt="no teacher">
<i style="display:none; z-index: 200; position: absolute; top: 35%; right: 42%; color: grey;" class="addTeacher fa fa-plus fa-2x"></i>
</div>
</div>
</a>
應該是'顯示:block',而不是'顯示:normal' –
沒有屬性名'normal'爲'display',用'block',而不是! –
真的!它出現在intelllisense列表 – user1186050