# How to put an icon over images which are within a slider

**URL:** <https://forum.ionicframework.com/t/how-to-put-an-icon-over-images-which-are-within-a-slider/139117>\
**Category:** ionic-v3\
**Created:** [August 21, 2018, 7:44am UTC](https://forum.ionicframework.com/t/how-to-put-an-icon-over-images-which-are-within-a-slider/139117 "2018-08-21T07:44:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kyrax80](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@Kyrax80](https://forum.ionicframework.com/u/Kyrax80)\
**Post date:** [August 21, 2018, 7:44am UTC](https://forum.ionicframework.com/t/how-to-put-an-icon-over-images-which-are-within-a-slider/139117/1 "2018-08-21T07:44:19Z")

</div>

Hello guys, I have the following code:

```auto
<swiper>
  <div *ngFor="let video of lista.videos" style="padding-top: 0px;">
          <button class="boton-slider" (click)="this.navCtrl.push('VideoPlayerPage', {video: video})">
              <ion-thumbnail>
                  <img [src]="video.miniatura">
              </ion-thumbnail>
              <p class="titulo-video">{{video.titulo}}</p>
           </button>
   </div>
 </swiper>

```

Which gives me the following:

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/7/6/76922e33dc4ed03bf586326e215de79d84e5aa00.png)

I need to put an icon in the place that there is a circle. It must be taken into account that those images slide horizontally and also the screen can scroll vertically.

How could I achieve this?

Also the swipper component I am using is from the [following library.](https://github.com/zefoy/ngx-swiper-wrapper)

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![hirenkorat3](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/hirenkorat3/32/128872_2.png) [@hirenkorat3](https://forum.ionicframework.com/u/hirenkorat3)\
**Post date:** [August 21, 2018, 7:49am UTC](https://forum.ionicframework.com/t/how-to-put-an-icon-over-images-which-are-within-a-slider/139117/2 "2018-08-21T07:49:52Z")

</div>

you can do that by give position css to button

```auto

<div *ngFor="let video of lista.videos" style="padding-top: 0px;">
          <button class="boton-slider" (click)="this.navCtrl.push('VideoPlayerPage', {video: video})">
              <ion-thumbnail>
                  <img [src]="video.miniatura">
              </ion-thumbnail>
              <p class="titulo-video">{{video.titulo}}</p>
              <div class="btnMore">...</div>
           </button>
   </div>

```

and class

```auto
.btnMore{
padding:5px;
position:absolute;
top:0;
right:0;
}

```

---

<div class="post-metadata">

**Author:** ![Kyrax80](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@Kyrax80](https://forum.ionicframework.com/u/Kyrax80)\
**Post date:** [August 21, 2018, 8:42am UTC](https://forum.ionicframework.com/t/how-to-put-an-icon-over-images-which-are-within-a-slider/139117/4 "2018-08-21T08:42:56Z")

</div>

Thank you very much, it worked perfectly!

---

<div class="post-metadata">

**Author:** ![Kyrax80](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@Kyrax80](https://forum.ionicframework.com/u/Kyrax80)\
**Post date:** [August 21, 2018, 11:26am UTC](https://forum.ionicframework.com/t/how-to-put-an-icon-over-images-which-are-within-a-slider/139117/5 "2018-08-21T11:26:25Z")

</div>

Could you tell me how to do it a list like this?

```auto
<button *ngFor="let video of lista.videos" ion-item detail-none (click)="this.navCtrl.push('VideoPlayerPage', {video: video})">
     <img class="thumbnail-buscar" ion-item item-start [src]="video.miniatura">
     <p class="titulo-video">{{video.titulo}}</p>
</button>

```

Doesn’t matter what I do with the same code, the text of the list is always dissapearing.

---

<div class="post-metadata">

**Author:** ![hirenkorat3](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/hirenkorat3/32/128872_2.png) [@hirenkorat3](https://forum.ionicframework.com/u/hirenkorat3)\
**Post date:** [August 22, 2018, 4:26am UTC](https://forum.ionicframework.com/t/how-to-put-an-icon-over-images-which-are-within-a-slider/139117/6 "2018-08-22T04:26:05Z")

</div>

probably default css of ion-item affect your button  
or don’t use `<p>` tag inside button because it also have default padding css issue.  
direct write {{video.titulo}} or inside div tag

---

<div class="post-metadata">

**Author:** ![Kyrax80](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@Kyrax80](https://forum.ionicframework.com/u/Kyrax80)\
**Post date:** [August 23, 2018, 6:24am UTC](https://forum.ionicframework.com/t/how-to-put-an-icon-over-images-which-are-within-a-slider/139117/7 "2018-08-23T06:24:59Z")

</div>

I’ve managed to make it work with this:

**HTML**

```auto
<button *ngFor="let video of lista.videos" ion-item detail-none (click)="this.navCtrl.push('VideoPlayerPage', {video: video})">
     <img class="thumbnail-buscar" ion-item item-start [src]="video.miniatura">
     <p class="titulo-video">{{video.titulo}}</p>
     <div class="video-visto-busqueda">
         <ion-chip color="primary">
            <i class="icon-sm icon-ophthalmology" aria-hidden="true"></i>
                <span class="label-chip">Visto</span>
         </ion-chip>
      </div>
 </button>

```

**CSS**

```auto
.video-visto-busqueda {
        padding: 0.1rem;
        position: absolute;
        top: 0.5rem;
        right: 28rem;
        color: map-get($colors, primary);
    }

    ion-chip {
        height: 2rem !important;
        padding-right: 1rem;

        i {
            font-size: 2rem !important;
            margin-right: -0.3rem !important;
            padding-left: 1rem !important;
            padding-top: 0.2rem !important;
            padding-right: 1rem !important;
            margin-top: -0.3rem !important;
        }
        
    
        .label-chip {
            font-size: 1rem !important;
            margin-top: -0.7rem !important;
            padding-top: 0.15rem !important;
        }
    }

```

But when I rotate the screen it looks bad:

**Vertical**

![image](https://global.discourse-cdn.com/ionicframework/original/3X/2/9/2945cefec63d8ed6d5e671116d8cb2b5c38a9662.png)

**Horizontal**

![image](https://global.discourse-cdn.com/ionicframework/original/3X/8/4/8408bae73de72be4306b82561577c8dd0731b6a7.png)

---

<div class="post-metadata">

**Author:** ![hirenkorat3](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/hirenkorat3/32/128872_2.png) [@hirenkorat3](https://forum.ionicframework.com/u/hirenkorat3)\
**Post date:** [August 23, 2018, 6:58am UTC](https://forum.ionicframework.com/t/how-to-put-an-icon-over-images-which-are-within-a-slider/139117/8 "2018-08-23T06:58:53Z")

</div>

if you want to manage both h/v ui then button is not good choice for it.  
you can use grid,row,col like this:

```auto
<ion-row *ngFor="let video of lista.videos">
<ion-col col-4>
 <img class="thumbnail-buscar" ion-item item-start [src]="video.miniatura">
<div class="video-visto-busqueda">
         <ion-chip color="primary">
            <i class="icon-sm icon-ophthalmology" aria-hidden="true"></i>
                <span class="label-chip">Visto</span>
         </ion-chip>
      </div>
 <ion-col>
<ion-col col-8>
{{video.titulo}} 
<ion-col>
</ion-row>

```

---

<div class="post-metadata">

**Author:** ![Kyrax80](https://avatars.discourse-cdn.com/v4/letter/k/aca169/32.png) [@Kyrax80](https://forum.ionicframework.com/u/Kyrax80)\
**Post date:** [August 23, 2018, 7:07am UTC](https://forum.ionicframework.com/t/how-to-put-an-icon-over-images-which-are-within-a-slider/139117/9 "2018-08-23T07:07:39Z")

</div>

With that the images look much smaller:

![image](https://global.discourse-cdn.com/ionicframework/original/3X/a/a/aad9891059458c8eb1f8ca0b1b352f2970f946ae.png)

---

<div class="post-metadata">

**Author:** ![hirenkorat3](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/hirenkorat3/32/128872_2.png) [@hirenkorat3](https://forum.ionicframework.com/u/hirenkorat3)\
**Post date:** [August 23, 2018, 7:24am UTC](https://forum.ionicframework.com/t/how-to-put-an-icon-over-images-which-are-within-a-slider/139117/10 "2018-08-23T07:24:57Z")

</div>

then you can set height,width of image using css  
so every time it will display same size image

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:22pm UTC](https://forum.ionicframework.com/t/how-to-put-an-icon-over-images-which-are-within-a-slider/139117/11 "2021-07-19T21:22:55Z")

</div>

Closed on July 19, 2021, 9:22pm UTC


