2016-11-05 164 views
2

當我打開/刷新.html文件時,懸停功能,而不是在我用鼠標懸停div時應用它的效果,並且在懸停它時沒有任何效果。該代碼與工作懸停功能相同,我不明白爲什麼當我懸停而不是在工作時,而是在頁面刷新上。HTML/CSS:懸停功能不起作用

有什麼建議嗎?

這裏的HTML:

(...)<div class="firstInbetween"> 
     <div class="insideInbetween" style="cursor: pointer"> 
      <p>TRADE</p> 
     </div> 
    </div> (...) 

這裏是CSS:

.insideInbetween { 
    background: #5D7075; 
    width: 60px; 
    font-family: 'Open Sans'; 
    font-size: 20px; 
    text-align: center; 
    border: 2px solid red; 
    padding: 25px; 
    margin: auto; 
    margin-top: 50px; 
    color: #333333; 
    -o-transition: background 0.5s linear; 
    -moz-transition: background 0.5s linear; 
    -khtml-transition: background 0.5s linear; 
    -webkit-transition: background 0.5s linear; 
    -ms-transition: background 0.5s linear; 
    transition: background 0.5s linear; 
} 


.insideInbetween:hover { 
    background: #b50000; 
} 

提前感謝!

編輯:下面是完整的文件,這樣就可以檢查出來:https://jsfiddle.net/arxs6b66/

+0

它適合我。 https://jsfiddle.net/6kLycL9L/ – pol

回答

0

.insideInbetween { 
 
    background: #5D7075; 
 
    width: 60px; 
 
    font-family: 'Open Sans'; 
 
    font-size: 20px; 
 
    text-align: center; 
 
    border: 2px solid red; 
 
    padding: 25px; 
 
    margin: auto; 
 
    margin-top: 50px; 
 
    color: #333333; 
 
    -o-transition: background 0.5s linear; 
 
    -moz-transition: background 0.5s linear; 
 
    -khtml-transition: background 0.5s linear; 
 
    -webkit-transition: background 0.5s linear; 
 
    -ms-transition: background 0.5s linear; 
 
    transition: background 0.5s linear; 
 
} 
 

 

 
} /* <-- DELETE THIS*/ 
 
.insideInbetween:hover { 
 
    background: #b50000; 
 
} 
 
.secondInside { 
 
    background-color: #123189; 
 
    color: white; 
 
    width: 35%; 
 
    float: left; 
 
    height: 500px; 
 
    margin: 2%; 
 
}

在整個JDS

那裏有一個{懸停之前,刪除它和它的作品