2 Replies Latest reply: Oct 27, 2010 8:40 AM by TCarp RSS

    Is .class-active:hover good css?

    TCarp Community Member

      I ran across some code for a menu that has this in the css:

       

       

      .ddmx .item1,

      .ddmx .item1:hover,

      .ddmx .item1-active,

      .ddmx .item1-active:hover { position:relative; display:block; padding:3px 10px 3px 10px; font:20px arial; background-color:#5B7893; color:#BECBD6; font-weight:bold; text-decoration:none; white-space:nowrap; width:195px; }

       

      I understand what .item1 and .item1:hover are but I've can't find any tutorial that shows something like .item1-active and .item1-active:hover.

       

      Is this legit css and if so what does it mean?

       

      Thanks

       

      Tom

        • 1. Re: Is .class-active:hover good css?
          MurraySummers CommunityMVP

          I understand what .item1 and .item1:hover are but I've can't find any tutorial that shows something like .item1-active and .item1-active:hover.

           

          Is this legit css and if so what does it mean?

           

          Yes, it's legit.

           

          .item1-active would refer to an item with that as a class assignment -

           

          <a class="item1-active" href="whatever.html">

           

          .item1-active:hover would refer to the hover state of that same item.

          • 2. Re: Is .class-active:hover good css?
            TCarp Community Member

            Thanks

             

            So what I'm hearing is the code is referring to two classes:  .item1 and .item1-active.  What confused me then was I found no class .item1-active anywhere in the html.

             

            Again, thanks.

             

            Tom