Web Analytics Made Easy -
StatCounter CSS: Referencing a color from another selector - CodingForum

Announcement

Collapse
No announcement yet.

CSS: Referencing a color from another selector

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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

    Comment

    Working...
    X