I'm attempting to style a link that appears only after an image, within separate HTML tags like this:
<p>
<a href=whatever>
<img stuff>
</a>
</p>
<p>
<a href=something>This text should have a distinct color</a>
This CSS rule "works":
p + p>a {
color: red;
}
However, it lacks specificity. I would like to achieve something similar to the following code snippet, but it seems to be targeting the sibling of the IMAGE rather than the PARAGRAPH:
p>a>img + p>a {
color:red
}
The first example works, but it may apply to unintended elements. The second example does not work at all, and perhaps it cannot be accomplished in this way. While I prefer using classes or ids, the project is written in markdown which translates to HTML. As such, my only option is to target elements based on their general structure rather than attributes (unless you have another solution?).