2 Replies Latest reply: Jul 29, 2014 9:54 PM by Rowby RSS

    Styling a class for links  Hover/active, etc

    Rowby Community Member

      Hello,

       

      This is a most basic question about formatting text links in css

       

      I have tried to do it myself. I got the hover to work -- at least in firefox. But can't get the default color to work. Only hover.

       

      Please look at this development page http://ogrowby.com/ in firefox.

       

      There is a menu about the middle of the page, called "Test Menu". Please click on that. Then, in the dropdown, go to "TEST LINK".

       

      When you hover over it, the text color changes to Gold. That is fine. But its default text color is black and I want it to be white. I may also want to change the font size, etc. But the main thing is to get the css working to set the default text color for this class to WHITE. #ffffff.

       

      Here's my css so far. The hover is working, but the default remains needs to be changed to #ffffff Only for the ".roundeddblue" class. And it needs to work not only in firefox but other modern browsers.

       

      Thanks, Rowby

       

      .roundedblue:link,
      div#Maximenu_NEW_GRANDE ul.maximenuck2 li.roundedblue:hover span.separator {
        color: white;
      }

      .roundedblue:hover,
      div#Maximenu_NEW_GRANDE ul.maximenuck2 li.roundedblue:hover span.separator {
        color: #FFB300;

      }

        • 1. Re: Styling a class for links  Hover/active, etc
          Liam Dilley CommunityMVP

          Hey there,

          One of your issues is that menu items like this - "Academics" are not links, you have put text in one should have been a seperator and why the li has a class "divider" and inside it is only a span "separator"

           

          Are you using the inspector tool of the browsers? Or Firebug?

          If not, you should, because you can see what elements have what CSS running on them

           

          For your menu there is this CSS - #nav ul.menu > li > a, #nav ul.menu > li > span.separator, #nav ul.maximenuck > li > a, #nav ul.maximenuck > li > span.separator

           

          This is on line 230 of your template.css

          This has the color set to #000000 - which is black, you want it to be white - #fff

          • 2. Re: Styling a class for links  Hover/active, etc
            Rowby Community Member

            Hi Liam

             

            Thanks for helping on this.  Yes, I do use firebug -- and its usually very helpful. But this time I could get down to the specific code.

             

            Thanks for the info on separators / links.  These separators will, in most cases, become links once the site is further developed, so I see that I will need to keep that in mind,

             

            More specifrically, if I do as you suggest (and I guess I could always just do it)   Wouldn't it change all of my non hover text to white.  Or just the the text in the roundedblue class.  I only want the link text (or I guess separator text) to go to White ffffff.

            This is on line 230 of your template.css

            This has the color set to #000000 - which is black, you want it to be white - #fff

             

            ...Rowby