css - Changing the background colour of an :after - JQuery -
i'm trying change colour of :after, using jquery although can't seem able change it, can point me in right direction please?
<script> $( document ).ready(function() { $( ".breadcrumb li:nth-child(1) a" ).css({'background-color' : '#f00'}); // works $( ".breadcrumb li:nth-child(1):after " ).css({'background-color' : '#f00'}); // not work? }); </script>
i've tried using few selectors cannot find correct one. in advance.
try this,
css
.li-active-after a{background-color : #f00; } .li-active-after:after{background-color : #f00; }
jquery
$( document ).ready(function() { $(".breadcrumb li").removeclass('li-active-after'); $(".breadcrumb li:nth-child(1)").addclass('li-active-after'); });
Comments
Post a Comment