Quick CSS question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lace
    Too lazy to set a custom title
    • Mar 2004
    • 16116

    #1

    Quick CSS question

    Trying to change the font color of a link h2.

    I guess the default "a" is taking over with another color.

    I have
    Code:
    .sponsors h2 a {
    	color:#FFF;
    }
    Then
    Code:
    <h2 id="sponsors"><strong>
    <a href="#" title=" " target="_blank" class="sponsors">BLAH</a>
    </strong></h2>


    Should it be this?
    Code:
    a:sponsors {
    	color:#FFF;
    }
    I know it's probably right in under my nose but I can't think straight right now.
    Your Paysite Partner
    Strength In Numbers!
    StickyDollars | RadicalCash | KennysPennies | HomegrownCash
  • Serge Litehead
    Confirmed User
    • Dec 2002
    • 5190

    #2
    if you use chrome you can right mouse click on particular element and find out exactly which rule is taking over color with "inspect element"

    btw .something in html is class="something"

    id="someid" in css marked such as #someid

    id > class


    edit, a:sponsors is way out of line, simply wrong , it's used to set properties for a:visited, a:link, a:active
    you can do a.sponsor:visited for exemple
    Last edited by Serge Litehead; 12-08-2011, 04:00 PM.

    Comment

    • nm_
      Confirmed User
      • May 2011
      • 328

      #3
      ya the . is the issue. change it to # it should work

      Comment

      • Lace
        Too lazy to set a custom title
        • Mar 2004
        • 16116

        #4
        Ahhh. Changed it and it's still not working. Hmmph
        Your Paysite Partner
        Strength In Numbers!
        StickyDollars | RadicalCash | KennysPennies | HomegrownCash

        Comment

        • Serge Litehead
          Confirmed User
          • Dec 2002
          • 5190

          #5
          cuz it's
          #sponsors a {...}

          or #sponsors strong a {..}

          Comment

          • Serge Litehead
            Confirmed User
            • Dec 2002
            • 5190

            #6
            one more tip

            NEVER use same id twice or more on the same page, that's what classes intended for

            Comment

            • DigitalTheory
              ^-^
              • Jul 2007
              • 1055

              #7
              Try
              #sponsors a:hover {
              color : #fff;
              }

              replace hover with link, active, visited, etc.
              Last edited by DigitalTheory; 12-08-2011, 04:06 PM.

              Comment

              • sarettah
                see you later, I'm gone
                • Oct 2002
                • 14297

                #8
                Originally posted by Lace
                Trying to change the font color of a link h2.

                I guess the default "a" is taking over with another color.

                I have
                Code:
                .sponsors h2 a {
                	color:#FFF;
                }
                Then
                Code:
                <h2 id="sponsors"><strong>
                <a href="#" title=" " target="_blank" class="sponsors">BLAH</a>
                </strong></h2>


                Should it be this?
                Code:
                a:sponsors {
                	color:#FFF;
                }
                I know it's probably right in under my nose but I can't think straight right now.
                The way you have that coded you just want (I think):

                .sponsors
                {
                color:#FFF;
                }

                Hey I can still edit this... damn. Not changing anything, just adding I am not a css expert in any way shape or form. I solve issues like this by throwing in an inline style and moving on.



                .
                Last edited by sarettah; 12-08-2011, 04:32 PM.
                All cookies cleared!

                Comment

                • Lace
                  Too lazy to set a custom title
                  • Mar 2004
                  • 16116

                  #9
                  Fuck it, just changed it to h4 and wrote up a new class that seemed to work.
                  Your Paysite Partner
                  Strength In Numbers!
                  StickyDollars | RadicalCash | KennysPennies | HomegrownCash

                  Comment

                  • adulttemplatestudio
                    Confirmed User
                    • Aug 2011
                    • 237

                    #10
                    Do you know if there is a body style set to the links?


                    you also have 2 styles to that, #sponsors and .sponsors
                    Removed or rename one of them?

                    Contact me and i will be happy to fix this issue for you.


                    * Contact: sales[a]sphexa.com
                    * ICQ: 623322515

                    Comment

                    • Lace
                      Too lazy to set a custom title
                      • Mar 2004
                      • 16116

                      #11
                      Yeah there was a body style for links, hence the reason I was trying to name it another class.

                      I've got it working now but thank you all.
                      Your Paysite Partner
                      Strength In Numbers!
                      StickyDollars | RadicalCash | KennysPennies | HomegrownCash

                      Comment

                      Working...