Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Aug 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb CSS: Referencing a color from another selector

    Hello friends

    I use some 3rd party component and I'm personalizing the style what is outputed.

    Let's say what the component generate the style like this:

    .Test { color: red; font-family: verdana; background-color: yellow; }

    in my page I wrote just the code:

    .Test { color: blue }

    And my css overriden the component generated css correctly, maintaining the font-family and background-color, and changing the Color. But in the ".Test A" and ".Test A:hover" I need change ONLY the color from ".Test". I know not speak this in CSS terms, but in programming like language I wish do this:

    .Test A, .Test A:hover{ color: .Test.Color }

    Exists some manner to do this?

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,253
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Nope

    Although admittedly this would be a useful option and this matter has been raised several times for that reason, alas: no, CSS offers no possibility to use a reference or a variable for supplying property values; just plain values.
    Regards,
    Ronald.
    ronaldvanderwijden.com


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •