Solving the problem of mini program canvas hiding

hzc
Release: 2020-07-01 09:54:53
forward
4611 people have browsed it

I believe that many times, everyone will encounter the need to use canvas to generate pictures.
Of course I also encountered it. After generating the canvas in the wxml page of the project, I found out how to add css to the canvas tag. I can't prevent the canvas from affecting the page.

 // 无论是opacity 还是 z-index 都无法解决,多多少少会影响 
Copy after login

After thinking about it for a while, I came up with the followingsolution:Add a parent tag to the outer layer ofcanvas, and then Control the display of the parent tag

 //让父标签 0宽 0高 隐藏溢出   
Copy after login

If the above does not work, please see the following:

 // 直接让canvas 飞到天际, 简单粗暴; 使用时注意 position的问题; 如果 fixed不行, 换其他定位试试 
Copy after login

ok .. Come on and write the code...

Recommended tutorial: "WeChat Mini Program

The above is the detailed content of Solving the problem of mini program canvas hiding. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:jianshu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!