Using css shape to click being an image?

泄露秘密 提交于 2019-12-24 11:50:11

问题


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

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'); }

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:


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.



来源:https://stackoverflow.com/questions/32712881/using-css-shape-to-click-being-an-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!