html2canvas
html2canvas copied to clipboard
Compatibility issues with CSS linear gradient attributes
Please make sure you are testing with the latest release of html2canvas. Old versions are not supported and issues reported for them will be closed.
Please follow the general troubleshooting steps first:
- [ ] I'm using the version of "html2canvas": "^1.4.1",
Bug reports:
As shown in the picture, there will be a border on the far right after being converted into an image.
my css code:
background: linear-gradient(90deg, rgba(182, 39, 141, 1) 29.13%, rgba(182, 39, 141, 0) 100%)
Specifications:
- html2canvas version tested with: 1.4.1
- Browser & version: Chrome 88.0.4324.190(正式版本) (64 位)
- Operating system: Windows
我也有这个疑问,后来用 mask-image 模拟这种渐变以缓解
这个问题我也遇到了。 我设置了background的position和size解决了,size超出box的宽度,将原本最右侧的线条挤出去。 参考:jsfiddle