I have a question which I can't find answered Googling around. I would like to know if there's a way to access elements attributes from CSS3 code itself (CSS for simplicity). I'm not looking for other solutions that make use of JavaScript or CSS classes and ids because I know well how to solve the problem in that way. My question is very specific.
As an example, let's say that I have the following CSS code:
body { color: black;}
p { color: green;}
and suppose that I want to set the color CSS attribute value of a specific tag/class/id to be the same as <body> by referencing it and not just placing a simple color:black specification. In other word, I would like to have something like this:
.mySpecificP { color: body.color;}
The HTML code should be something like this:
<html>
<head>
<style>
body { color: black;}
p { color: green;}
.mySpecificP { color: body.color;}
</style>
</head>
<body>
<p>This is a green paragraph.</p>
<p class="mySpecificP">This is a black paragraph.</p>
</body>
</html>
Here I'm using <p> just as an example. I'm wondering if there's a solution to the body.color pseudo-code I used in the CSS definition of mySpecificP class.
inheritor something similar? Perhaps acolor:root?