How to use image replace icon tab

i want use ion-tab with icon is a image. how to replace current font icon with a image?
who can help me?

some thing like this

<ion-tab
Img ="img.jpg"></ion-tab>

Hey there!

You should check out this thread. A few others have managed to do this by referencing a CSS class that contains a background image - which you would set to your custom image.

1 Like

Thank drew,
yes, this way helpful to me.
But if we can change directive and just add other attributes, it’s better, because i’m creating other tab layout based on available layout.
Eg:

<ion-tab
Img ="img.jpg"></ion-tab>

Hi everyone!
who can help solve this issues or suggest any solution for that?

Hi @hoangloi

Can you try following code structure…

Html–

    <ion-tab title="" icon-on="ion-home" icon-off="ion-home" href="#/tab/home"> 
<ion-nav-view name="tab-home">
</ion-tab>

Css–

.ion-home:before{
content: “”;
}
.ion-home{
background-size: 100% 100%;
background-repeat: no-repeat;
border: none;
}
.ion-home.active{
background-image: url(‘img/img.png’);
}
.ion-home.deactive{
background-image: url(‘img/img.png’);
}

1 Like

@shashikant Many thanks for reply.
but i want use {{variables}} for background url. because background will change.
eg

.class-name{
background-image: url({{variables}});
}

but angularjs don’t support and this issues we don’t use ng-style ?

Please help. I don’t find any solution for this issue.

You cant make it dynamic with CSS. So you should embed that style inline next to the element or within the style tag on the element itself.

I tried your method, but its not working, it still shows up as the ion-home icon. Did you ever get this to work?