Sooner or later most web developers stumble over one not so insignificant weakness of CSS3 Selectors, you can’t select parent elements. So while you can select img elements with an a parent, you can’t select a elements with an img child.
But this has recently been solved in a very clever way with the latest CSS4 Selectors working draft, where you can just change the subject of a selector by prepending a dollar sign to one of the compound selectors. And you might have guessed it, Mojolicious already brings this neat little feature to Perl. :)