niklasvh / html2canvas

Screenshots with JavaScript
https://html2canvas.hertzen.com/
MIT License
30.65k stars 4.82k forks source link

Elements inside generate result have strange vertical position error [keywords: tailwind, vue, tailwindcss] #3170

Closed fr1g closed 7 months ago

fr1g commented 7 months ago

Please follow the general troubleshooting steps first:

Bug reports:

Elements inside generate result have strange vertical position error, seems all are positioned at a lower place as expected.

Specifications:

Screenshot:

image upper: how the original html looks like lower: what the image actually rendered inside canvas

Others

you can take a glance on my project demo HERE but this one fully written in Chinese. and the project's source code is HERE

Also See

similar issue: #3031

fr1g commented 7 months ago

btw to use "canvas append inside body" debugging behavior in the deployed demo, type ?localhost after address and then refresh -> f12 -> invoke DebugCondition2() in console ... maybe work. just click the left-bottom corner yellow button will invoke generation (生成)

fr1g commented 7 months ago

SOLVED this was caused by default tailwindcss behaviour, and solution is avaliable here: StackOverFlow

fr1g commented 7 months ago

I've added some keywords into the title in order to make others able to seek such a solution easier via searching.