android - ionic overwrite active element in css -
i tried many example answer stackoveflow no 1 useful in application please me solve problem thank
sidemenu:
<ion-list class="side" id="sidemenuactive"> <ion-item menu-close href="#/sidemenu/home"> <i class="icon ion-ios-home-outline"></i> home </ion-item> <ion-item menu-close href="#/sidemenu/mydeal"> <i class="icon ion-compose"></i> profile </ion-item> </ion-list>
css:
#sidemenuactive .active{background: #000000 !important;}
the ion-item directive injects "a" element in content. element need use when define styles.
<ion-list> <ion-item ui-sref=".item1" ui-sref-active="active">item 1</ion-item> <ion-item ui-sref=".item2" ui-sref-active="active">item 2</ion-item> </ion-list>
css:
ion-list ion-item.active { background-color: #000 !important; }
nb: have add (at place) "active" class active ion-item. did using directive ui-sref-active. please mind ionic use angular-ui router , you'd better use ui-sref instead of href links. ui-sref allows directly give name of route parameter (thus, don't have handle uri).
Comments
Post a Comment