2016-02-10 55 views
0

文本顏色我想改變我的導航欄的字體顏色。我嘗試過顏色:xxx;字體顏色:xxx;無處不在。我在想事情正在取消,但我無法弄清楚。我怎麼把它從紅色變成白色。在此先感謝改變字體/導航欄中

HTML:

<ul id="drop-nav"> 
     <li><a href="homepage.html">Home</a></li> 
     <li><a href="parks.html">Parks</a> 
     <ul> 
      <li><a href="magickingdom.html">Magic Kingdom</a></li> 
      <li><a href="epcot.html">EPCOT</a></li> 
      <li><a href="hollywoodstudios.html">Hollywood Studios</a></li> 
     <li><a href="animalkingdom.html">Animal Kingdom</a></li> 
     </ul> 
     </li> 
     <li><a href="kids.html">Kids</a></li> 
     <li><a href="discounts.html">Discounts</a></li> 
     <li><a href="events.html">Events</a></li> 
     <li><a href="tips.html">Tips</a></li> 

    </ul> 

CSS:

<style type="text/css"> 
    ul { /*remove bullets & margins & padding from list*/ 
    list-style: none;padding: 0px;margin: 2px; 
    } 

    ul li { /*navigation bar*/ 
    display: block; 
    position: relative; 
    float: left; 
    border:2px solid black; 
    font-size: 20px; 
    width: auto; 
    text-align: center; 
    margin-left: 85px; 
` `margin-bottom: 30px; 
` `background-color: black; 
     } 
    li ul {display: none; } 
    ul li a {display: block; background: red; padding: 5px 10px 5px 10px; text-decoration:none; 
      white-space: nowrap; color: white; border: 2px solid black; 
      } 
    ul li a:hover {background: red; } 
    li:hover ul {display: block; position: absolute; left: auto; right: 0; margin-right: -60px; } 
    li:hover li {float: none;} 
    li:hover a {background: red;text-decoration: none; color: black; text-align: center; } 
    li:hover li a:hover {background: #000; color: red;} 
    #drop-nav li ul li {border-top: 0px; } 
+0

你關閉你的風格標籤的任何地方? – kojow7

+0

此外,你可以爲你想變白什麼更加清晰。主菜單中的文字是白色的。當它盤旋時變黑。 Parks菜單下方的文字是黑色的,但在懸停時會變成紅色。 – kojow7

+0

http://jsbin.com/tacequzebo/edit?html,css,js,output工作'UL立了'被重寫類'UL li' –

回答

0

改變你的CSS來this.I只關心你的文字顏色和背景顏色,

ul li{ 
    background-color: red; 
    } 

    ul li a{ 
    text-decoration: none; 
    color: white; 
    } 

    ul li:hover{ 
    background: white; 
    } 

    ul li a:hover{ 
    color: red; 
    } 
0

嘗試!在CSS重要

顏色:XXX重要

+0

謝謝你的工作 – Shelby