https://onedrive.live.com/embed iframe shows to much space around the document

iqworks Information Quality Works 316 Reputation points
2025-02-27T02:08:02.0233333+00:00

Hi, I am glad to see a way to show my formatted MS word docs inside of my web pages. But Onedrive shows to much space around the document when I display it in a iframe.  

  I am not sure about the CSS I need to close the space here.

  Or maybe there are other ways to display my fully formatted document from within my web pages?

  Also, is iframe the only tool I can use to display my word docs inside of web pages?

  Thanks for any suggestions or advice

ASP.NET API
ASP.NET API
ASP.NET: A set of technologies in the .NET Framework for building web applications and XML web services.API: A software intermediary that allows two applications to interact with each other.
387 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. XuDong Peng-MSFT 11,336 Reputation points Microsoft Vendor
    2025-02-27T08:59:49.1533333+00:00

    Hi @iqworks Information Quality Works,

    Also, is iframe the only tool I can use to display my word docs inside of web pages?

    As far as I know, there are some tools (for example Mammoth.js) that can get the document content to display in a div element, but they are often not satisfactory (they cannot fully restore the styles within the document).

    In my opinion, the iframe element is currently the best way to present document files in web page.

    Best regards,

    Xudong Peng


    If the answer is the right solution, please click "Accept Answer" and kindly upvote. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.