ad08
ad08

Reputation: 2612

icon makes the button not clickable

I have a button, on which I have an absolute positioned search icon. the Button is working fine on the edges but not on an icon. The button is unclickable for the entire portion of the search icon.

button with a absolute positioned icon

code for Icon placement

.custom-position {
right: 32px;
position: absolute;
top: 27%;}

Is it possible to make the button clickable on the places where the icon is occupying space?

Upvotes: 3

Views: 2195

Answers (1)

segFault
segFault

Reputation: 4054

You could try adding: pointer-events: none to your icon/image.

Example:

.custom-position {
  right: 32px;
  position: absolute;
  top: 27%;
  pointer-events: none;
}

pointer-events docs

Upvotes: 6

Related Questions