The html of a webpage dynamically inserted in an iframe looks slightly different than the original page

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:

enter image description here

Page with iframe with html dynamically inserted

enter image description here

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

?

+3
1

, paddings, quirks .
, DOCTYPE .

, DOCTYPE, , iframe DOCTYPE. ( , .)

+1

All Articles