html element converted to image is missing to css styling

154 Views Asked by At

I am currently building a web app that allows users to create or mimic chats on different social media platforms, so far I am done with the html and css but I have been having issues trying to perfectly capture the html element of the chat section so it will look like a screenshot, I have tried using html2canvas and domtoimage libraries but the snapshot/captured html image always omits some vital css styling like background image, border radius and many other stylings

I have tried using libraries like html2canvas, html-to-image, dom-to-image and they all yield the same outcome, i.e making a snapshot that is missing most of the css styling. attached below is an exampleThis is what the screenshot is supposed to look like but this is what it looks like when the download button is triggered

0

There are 0 best solutions below