2015-03-13 34 views
0

我想讓我的文字爲深灰色(#232323),然後在懸停時將它改爲橙色(#f66511)並加下劃線。如何讓文字變成深灰色,然後在鏈接上懸停橙色?

看着我的jsfiddle,我錯過什麼在我的代碼:

http://jsfiddle.net/huskydawgs/brwb2r7a/9/

這裏是我的HTML:

<div id="wrapper-landing"> 
    <div id="wrapper-icons"> 
     <div class="icons_row"> 
      <div class="icons_cell1 greyBoxOnHover"> 
       <a href="http://en.wikipedia.org/wiki/Apple"><img alt="Gala" height="140" src="http://www.clipartbest.com/cliparts/acq/ezj/acqezjKcM.jpeg" style="display:block; margin:0 auto;" width="140" /> </a> 
       <p class="video-title rtecenter"> 
        <a href="http://en.wikipedia.org/wiki/Apple">Wasington Apples:<br />Gala</a></p> 
      </div> 

</div> 

CSS:

#wrapper-landing { 
    width: 916px; 
    margin: 0 auto 50px auto; 
    padding: 0; 
} 

.rtecenter { 
    text-align: center; 
} 

#wrapper-icons { 
    position:relative; 
    width:100%; 
    border: none; 
    margin: 35px 0 0 0; 
} 

.icons_row { 
    height:100%; 
    white-space:nowrap; 
    } 

.icons_cell1, .icons_cell2, .icons_cell3, .icons_cell4 { 
    height:100%; 
    width:25%; 
    display:inline-block; 
    white-space:normal; 
    padding-top:15px; 
    } 

    .greyBoxOnHover:hover { 
    background-color: #e2e3e4; 
} 

#wrapper-landing p.video-title { 
    color: #232323; 
    font-size: 12px; 
    line-height: 12px; 
    text-align: center; 
} 

#wrapper-landing p.video-title a { 
    text-decoration: none; 
} 

#wrapper-landing p.video-title hover { 
    text-decoration: underline; 
    color: #f66511; 
} 

回答

1

你有你的懸停當它應該是時寫爲

您錯過了:a選擇器。

1

哈弗是:hover,在過去的CSS定義必須是

#wrapper-landing p.video-title a:hover 
           ^
0
#wrapper-landing p.video-title a:hover { 
    text-decoration: underline; 
    color: #f66511; 
} 

你忘了:

相關問題