Using css shape to click being an image?

2019-08-10 14:06发布

I am trying to get an input field and button to work even when they are behind a shaped png image.

enter image description here

Now i thought all i had to do was using shape and it would trace the shape. And the button or input field would be editable/clickable

.element { float: left; height: 150px; width: 1300px; shape-outside: img('path/to/red-image-with-shape.png'); }

enter image description here

ps: this situation is a screenshot when an user scrolls upwards. The designer wants the form elements to be accessible even with these scrolling situation.

1条回答
forever°为你锁心
2楼-- · 2019-08-10 14:55

Set pointer-events: none to the element with the shape. As far as I know there is no other solution. Maybe you could try to make input field transparent and change the z-index. But that would not be what you want. By the way it is not user-friendly to hide the content of the input field.

查看更多
登录 后发表回答