Note that there are some explanatory texts on larger screens.

plurals
  1. POCSS - hover doesn't work
    primarykey
    data
    text
    <p>I have these css code:</p> <pre><code> .tabs_inactive { border: 1px solid #cccccc; border-top-left-radius: 8px; border-top-right-radius: 8px; background-color: #eeeeee; border-bottom: #cccccc; } .tabs_inactive:hover { background-color: #ff8000; border-color: #ff8000; cursor: pointer; } /*this does not work*/ .tabs_inactive:hover a { color: #ffffff; } .tabs_active { background-color: #ffffff; border-bottom: 2px solid #ffffff; } .tabs_active:hover{ background-color: #ffffff; border: 1px solid #cccccc; border-bottom: 2px solid #ffffff; cursor: default; } .tabs_active:hover a { cursor: default; } </code></pre> <p>The last one (<code>.tab_active:hover a</code>) is working perfectly in my webpage, but the third block is not. I can not figure out why this happened. Could somebody explain me why the third block doesn't work? Thanks!</p> <hr> <p>UPDATE 1: Here is the relative JavaScript code:</p> <pre><code>//add class "tabs_inactive" to the original tabs option. $( "#tabs ul li" ).addClass("tabs_inactive"); //default: set the first tab as the active one. $( "#tabs ul li" ).first().toggleClass("tabs_active"); //to make sure the style sheet will be changed when click on the inside &lt;a&gt; tag $( "#tabs ul li a" ).live( "click", function () { //close other tabs $( this ).parents("ul").children("li").each( function (){ if( $(this).hasClass("tabs_active")){ $(this).removeClass("tabs_active"); } }); $( this ).parent().toggleClass("tabs_active"); return false; }); //change the class to "tabs_active" when the tab is clicked $( "#tabs ul li" ).live( "click", function () { //close other tab $( this ).parent().children("li").each( function (){ if( $(this).hasClass("tabs_active")){ $(this).removeClass("tabs_active"); } }); $( this ).toggleClass("tabs_active"); }); </code></pre> <p>And also HTML code:</p> <pre><code> &lt;div id="tabs"&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#homepage"&gt;HOME&lt;/a&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#option1"&gt;option1&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt; &lt;div id="homepage"&gt; &lt;p&gt; HOME: Here is the home page &lt;/p&gt; &lt;/div&gt; &lt;div id="option1"&gt; &lt;p&gt; Option1: Here is the tag page 1 &lt;/p&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>So, yes, I am trying to implement a tab menu, and this is a practice so I don't want to use the original JqueryUI function. Dose somebody know that what is the problem? Thank you.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload