2014-04-22 53 views
0

我想要做的就是將鼠標懸停在以橙色顯示的任何元素上時,更改以綠色標記的元素的旋轉。我知道你可以擁有的東西像從不同類別編輯類

ul li.classname 

我已經試過這樣的事情,但不認爲我完全理解不同層次去通過訪問不同的元素。

enter image description here

代碼本身:

<!-- Begin Links To Different Pages --> 
     <nav id="navigation" style="margin-top:-15px;margin-left:-50px"> 
      <ul style="list-style:none" class="test"> 
       <a href="index.html"><img id="home-button" src="images/Home_Button.png"></a> 

       <!-- Sweets Link --> 
       <li class="sweets-tabVis"><a href="ProductsPage.html"><img id="sweets-button" src="images/Sweets_Button.png"></a></li> 
       <ul style="list-style:none" class="sweets-tabInVis"> 

        <li class="test"><a href="ProductsPage.html"><img src="images/AllSweets_Button-Dropdown.png"></a></li>  

        <!-- Begin Type Tab --> 
        <li class="type" style="margin-top:-6px;"><a href="http://www.google.co.uk"><img src="images/Type_Button-Dropdown.png"></a></li>   
         <!-- Begin Sublink Type Navigation --> 
          <li class="sweets-sublink" style="margin-top:-62px;">      
           <a href="ProductsPage.html" ><img src="images/Boiled_Button-Dropdown.png"></a> 
           <a href="ProductsPage.html" ><img style="margin-top:-7px;" src="images/Chewy_Button-Dropdown.png"></a> 
         <!-- End Sublink Type Navigation --> 
          </li>      
        <li style="margin-top:-7px;"><a href="ProductsPage.html"><img src="images/Flavours_Button-Dropdown.png"></a></li>  
        <!-- End Type Tab --> 
       </ul> 


       <a href="ContactUs.html"><img id="contact-button" style="margin-left:250px;" src="images/Contact_Button.png"></a> 
       <!-- Begin Links To Different Pages --> 
       <section> 
        <img id="search-bar" src="images/Search_bar.png"> 
        <input id="search-box" style="position:absolute;margin-top:-70px;margin-left:920px;height:20px;font-family:Hobo Std;font-size:14px;width:150px" value="Search..." type="text"> </input> 
       </section> 
      </ul> 
     </nav> 
     <!-- End Navigation --> 

感謝您的幫助!

+0

你會編輯你的問題,使其更清楚。你的意圖目前還不清楚。具體來說:對橙色線的操作會對綠色標記的線產生什麼影響? – enhzflep

+0

那麼現在呢,我只是想知道如何實際編輯這些行(哪一行css會授予我訪問權限),然後我將在後面的所有CSS中加入。 – user2799788

+0

簡單。在您最喜歡的瀏覽器中打開頁面,然後右鍵單擊您感興趣的元素。您可以看到與該元素關聯的樣式。您還將獲得適用的所有CSS規則的文件和行號。在(Google)Chrome的上述評論中對您的用戶名這麼做,Chrome告訴我相關的樣式是:'a.comment-user.owner','a.comment-user','a:visited','。所有者','a' – enhzflep

回答

0

在CSS中,沒有辦法選擇一個包含您正在使用的類的類。

也許如果您嘗試參加上述課程(test)?

.test > .sweets-tabVis {your style} 
+0

嗯,我試過這個,它不工作。是因爲我有這麼多嵌套li和ul標籤嗎? – user2799788

+0

對不起,我在你的'li'類中增加了一個空格。你沒有嘗試過嗎? – MaxLascombe

+0

是啊仍然沒有工作,它會是這樣的:.test li.type:hover> .sweets-tabVis { \t margin-left:1000px; } – user2799788