0

Can anyone please tell me How can I show the icon in the middle of the image left and right side?

I tried many solutions but they not worked.

.slide {
  display: inline-block;
  font-size: 16px;
  line-height: 20px;
  padding: 7px 4px;
  margin: 5px;
  cursor: pointer;
  height: 32px;
  width: 32px;
  background-color: #2874f0;
  border-radius: 50%;
  color: #fff;
  text-align: center;
}

.image {
  height: auto;
  width: auto;
  max-height: 350px;
  max-width: 100%;
  display: block;
  margin: 0 auto;
}
<div style="width:100%" (click)="open_slider()">
  <a class="slide">></a>
  <img style="" src="https://www.vsss.co.in/Admin/uploads/472075/POLAN.jpg">
  <a class="slide"><</a>
</div>
Anzil khaN
  • 1,904
  • 1
  • 14
  • 25

1 Answers1

0

Use vertical-align: middle; to img and .slide for vertical align. And use text-align: center; to parent div for horizontal align.

Here is the working snippet.

.slide {
  display: inline-block;
  font-size: 16px;
  line-height: 20px;
  padding: 7px 4px;
  margin: 5px;
  cursor: pointer;
  height: 32px;
  width: 32px;
  background-color: #2874f0;
  border-radius: 50%;
  color: #fff;
  text-align: center;
  vertical-align: middle;
}

.image {
  height: auto;
  width: auto;
  max-height: 350px;
  max-width: 100%;
  display: block;
  margin: 0 auto;
}
img {
  display: inline-block;
  vertical-align: middle;
}
<div style="width:100%; text-align: center;" (click)="open_slider()">
  <a class="slide">></a>
  <img style="" src="https://www.vsss.co.in/Admin/uploads/472075/POLAN.jpg">
  <a class="slide">
    <</a>
</div>
Anzil khaN
  • 1,904
  • 1
  • 14
  • 25