2013-10-11 4 views
0

Навигационные кнопки курсора не полностью окрашены, когда на них нависает мышь. Я попытался изменить ширину до 100%, что, как я думал, исправит ее, но это не так. Я попытался найти несколько похожих проблем и решений, однако все решения, которые я нашел, не устранили проблему, поэтому я решил лично ее задать. Мысли?Навигационные кнопки наведения не полностью окрашены?

HTML:

<!DOCTYPE html> 
<html> 
    <head> 
     <meta charset="UTF-8" /> 
     <title>Sunny Acres</title> 
     <script src="modernizr-1.5.js"></script> 
     <link href="sa_layout.css" rel="stylesheet" type="text/css" /> 
     <link href="sa_styles.css" rel="stylesheet" type="text/css" /> 
     <style type="text/css"> 
      section > p:first-of-type:first-line { 
       text-transform: uppercase; 
      } 
      section > p:first-of-type:first-letter { 
       font-size:250% font-family:'Times New Roman', Times, serif; 
      } 
     </style> 
    </head> 

    <body> 
     <header> 
      <h1> 
       <img src="salogo.png" alt="Sunny Acres" /> 
      </h1> 
     </header> 
     <nav> 
      <ul> 
       <li><a href="home.htm">Home</a> 
       </li> 
       <li><a href="maze.htm">Autumn Fun</a> 
       </li> 
       <li><a href="haunted.htm">Scary Good</a> 
       </li> 
       <li><a href="petting.htm">Meet the Animals</a> 
       </li> 
       <li><a href="produce.htm">For your Tastebuds</a> 
       </li> 
      </ul> 
     </nav> 
     <section> 
      <header> 
       <h1>Welcome</h1> 
      </header> 
      <img src="photo1.jpg" alt="home page photo" id="promoimage" /> 
      <p id="firstp">There's always something happening at Sunny Acres. With the coming of fall, we're gearing up for our big AutumnFest and Farm Show. If you haven't visited our famous <a href="maze.htm">Corn Maze</a>, be sure to do so before it gets torn down on November 5. This year's maze is bigger and better than ever.</p> 
      <p>Farms can be educational and Sunny Acres is no exception. Schools and home-schooling parents, spend an afternoon with us at our <a href="petting.htm">Petting Barn</a>. We have over 100 friendly farm animals in a clean environment. Kids can bottle feed the baby goats, lambs, and calves while they learn about nature and the farming life. Please call ahead for large school groups.</p> 
      <p>When the sun goes down this time of year, we're all looking for a good fright. Sunny Acres provides that too with another year of the <a href="haunted.htm">Haunted Maze</a>. Please plan on joining us during weekends in October or on Halloween for our big Halloween Festival.</p> 
      <p>Of course, Sunny Acres is, above all, a <em>farm</em>. Our <a href="produce.htm">Farm Shop</a> is always open with reasonable prices on great produce. Save even more money by picking your own fruits and vegetables from our orchards and gardens.</p> 
      <p class="closing">We all hope to see you soon, down on the farm. 
       <br />&mdash; Tammy &amp; Brent Nielsen</p> 
      <h2>Hours</h2> 

      <ul> 
       <li>Farm Shop: 9 am - 5 pm Mon - Fri; 9 am - 3 pm Sat</li> 
       <li>The Corn Maze: 11 am - 9 pm Sat; 11 am - 5 pm Sun</li> 
       <li>The Haunted Maze: 5 pm - 9 pm Fri &amp; Sat</li> 
       <li>Petting Barn: 9 am - 4 pm Mon - Fri; 11 am - 3 pm Sat &amp; Sun</li> 
      </ul> 
      <h2>Directions</h2> 

      <ul> 
       <li>From Council Bluffs, proceed east on I-80</li> 
       <li>Take Exit 38 North to the Drake Frontage Road</li> 
       <li>Turn right on Highway G</li> 
       <li>Proceed east for 2.5 miles</li> 
       <li>Sunny Acres is on your left; watch for the green sign</li> 
      </ul> 
     </section> 
     <footer> <address> 
       Sunny Acres &nbsp;&#9728;&nbsp; 
       Tammy &amp; Brent Nielsen &nbsp;&#9728;&nbsp; 
       1977 Highway G &nbsp;&#9728;&nbsp; 
       Council Bluffs, IA &nbsp;&nbsp; 51503 
      </address> 
     </footer> 
    </body> 

</html> 

CSS:

@font-face { 
    font-family: 'NobileRegular'; 
    src: url('nobile-webfont.eot'); 
    src: local('☺'), 
     url('nobile-webfont.woff') format('woff'), 
     url('nobile-webfont.ttf') format('truetype'), 
     url('nobile-webfont.svg#webfontsKo9tqe9') format('svg'); 
} 

/* body styles */ 
body { 
    background-color: white; 
    font-family: NobileRegular, Verdana, Geneva, sans-serif; 
    line-height: 1.4em; 
} 

/*heading styles */ 
section h1 { 
    background-color: rgb(125, 186, 240); 
    color: white; 
    font-size: 1.7em; 
    letter-spacing: 0.4em; 
    text-indent: 1em; 
    line-height: 1.8em; 
} 
h2{ 
    background-color: rgb(0,154,0); 
    color: white; 
    color : rgba(255, 255, 255, 0.8); 
    letter-spacing: 0.4em; 
    text-indent: 1em; 
    line-height: 1.8em; 
} 

/* navigation styles */ 
nav ul { 
    list-style-type: none; 
    padding-left: 0.5em; 
    background-color: rgb(125,186,240); 
    line-height: 3.5em; 
    width:none; 
    float:none; 
} 
nav ul li a { 
    color: white; 
    text-decoration: none; 
    width:100%; 
    float:none; 
} 
nav ul li:hover { 
    background-color: rgb(83,142,213); 
    width:none; 
    float:none; 
} 
/*nav ul li:first-of-type { 
text-transform: uppercase; 

} 
*/ 

/* section styles */ 
section p.closing { 
    color: rgb(0,165,0); 
    text-align: right; 
} 
section h2+ul { 
    list-style-image: url(arrow.png); 
} 

/* footer styles */ 
footer address { 
    background-color: rgb(55,102,55); 
    color: white; 
    color: rgba(255,255,255,0.8); 
    font: normal small-caps 0.8em/4em 'Times New Roman', Times, serif; 
    text-align: center; 
} 

ответ

0

удалить обивка из <ul> и добавить его в <li> here is the fiddle

+0

Технически решить эту проблему, но это также перемещает мой текст поверх, что я есть что у меня есть отступы там в первую очередь. Спасибо за вашу помощь! – Nick

0

Изменить эти два стиля вы получите желаемый результат.

стили

/* навигация */

nav ul { 
    list-style-type: none; 
    padding-left: 0.5em; 
    background-color: rgb(125,186,240); 
    line-height: 3.5em; 
    PADDING-LEFT:0; 
    width:none; 
    float:NONE; 
    } 


nav ul li a { 
    color: white; 
    text-decoration: none; 
    PADDING-LEFT:10PX; 
    width:100%; 
    float:none; 
    } 
+0

Фантастический !!! Это решило проблему! Спасибо огромное! – Nick

+0

:) добро пожаловать. – Akhil

Смежные вопросы