css - a:hover變色問題

來源:互聯網
上載者:User

標籤:

今天在幫我們學校做網站的時候,由於在css這裡不是很擅長,過程中發現一個問題,a:hover的時候,字型的顏色不變.後來才發現將a和div的嵌套的問題,

我的css代碼為:

.left_box .lb_wrap .lb_theme {    color:#900;    text-align:center;    height:30px;    display: block;;    margin-left: auto;    margin-top: 1px;    line-height: 35px;}.left_box .lb_wrap  a {    display:block;    text-align:center;    height:30px;    width:100%;}.left_box .lb_wrap a:link {    color:#900;    background: #FFF no-repeat 5px 12px;    text-decoration:none;}.left_box .lb_wrap  a:hover {    color:#FFF;  /*滑鼠滑過的時候,字型應該變為該色調(白色),但是實際上沒有*/    background:#800  no-repeat 5px 12px;    font-size: 12px;    font-weight: bolder;    text-decoration:none;}.left_box {    border: 1px solid #09F;    margin-top: 16px;}/*lb:left box*/.left_box .lb_wrap {    width:95%;    background:#900;    margin-top:5px;    margin-left: auto;    margin-bottom:30px;    font: Arial, "宋體";}

html代碼為:

<div class="left_box"><div class="lb_wrap">    <div class="lb_title">國家、廣西特色專業</div>    <a href="/Item/88951.aspx">    <div class="lb_theme">地理資訊系統</div> <!--div不能放在div中,否則a:hover不起作用-->    </a>    <div class="lb_theme"><a href="/Item/88943.aspx">地理科學(教師教育)</a></div></div>

 

css - a:hover變色問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.