I have a webpage for which I take html, send it via websockets via socket.io to another page with an empty iframe and dynamically insert html into the iframe.
The code I use to embed html is as follows:
frame.open();
frame.write(html);
frame.close();
However, it appears that some sizes and spacing of the DOM elements appear slightly different than the original page.
Here are two screenshots to show you what I mean. It’s hard to see the differences, but the search lines above have a slightly different length, and the names of each song have slightly different distances from the large thumbnail:
Original page:

Page with iframe with html dynamically inserted

html URL- URL-. , html, . , css- .
?