wordpress - CSS adjust style of element where its child does have class -
is there pure css way adjust styling of element child not have class?
for example:
<a><img class="avatar pro"></a> <a><img class="avatar"></a>
and want style "a" containing child class "pro"?
background following: in buddypress, have hook add class avatars:
add_filter( 'bp_core_avatar_class', 'filter_bp_core_avatar_class', 10, 4 );
however, since :before / :after-pseudo-classes not work on images, need able adjust wrapping container.
thanks! raphael
no, there no parent selectors purely in css. here's discussion on it: https://css-tricks.com/parent-selectors-in-css/
however, if you're using buddypress, jquery comes autorolled it. add script theme file following:
$( "img.pro" ).parent().css( "border", "5px solid red" );
Comments
Post a Comment