Selecting A Sibling Of A Parent
I've got this HTML: user message I know the font tag
Solution 1:
You cannot select the parent with CSS - you might find this an interesting read on the topic: Why we don't have a parent selector. However, you can do one of the following:
1. Use a bit of JavaScript
2. Change your HTML to
<font>
<a href="profile/user"><b>user</b></a>
<font>message</font>
</font>
and you can do this:
a[href*="user"] + font { /* YOUR STYLES HERE */ }
Solution 2:
You cannot move a level up to an element´s parent using CSS.
Post a Comment for "Selecting A Sibling Of A Parent"