html2canvas 在错误位置渲染固定元素
当我在具有固定标题的页面上使用 html2canvas 时,它会将标题呈现在画布底部附近,而不是应位于顶部的位置。是否有解决方法,以便将固定元素呈现在正确的位置?
When I use html2canvas on a page with a fixed header, it renders the header near the bottom of the canvas rather than where it should be at the top. Is there a workaround for this so that it renders fixed elements in the correct position?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果没有看到您的代码,您可能需要指定 标题的子元素的vertical-align属性为
text-top
。Without seeing your code, it is possible that you need to specify the vertical-align property of the header's children elements to be
text-top
.将scrollX和scrollY设置为0可以解决这个问题。
Setting scrollX and scrollY to 0 sorted the issue.