Are you sure? You would need to use a DOM inspector or other development tool that can show the generated DOM or source code to actually see what element the imported page ended up in.
The problem might be css on the imported page or even on the importing page, or possibly a combination of the two.
And/or, if the imported page has its own DOCTYPE, html, and/or body tags, that might be a factor.
You could also experiment with alternatives to:
If you want more help, please include a link to the page on your site that contains the problematic code so we can check it out.
$('#content').html($('#content').html() + data);