web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Can I Crop a Power App...
Power Pages
Answered

Can I Crop a Power Apps Portal iframe

(0) ShareShare
ReportReport
Posted on by 5,345 Moderator

I am practicing with a Power Apps Portal iframe. The content is shown below.

 

I would like to format the iframe so that all of the top (red) is hidden and the same amount of space below the picture is revealed; basically shorten the page displayed in the view by a few inches from the top.

 

I tried padding, that had the wrong effect.

 

Phineas_0-1641409362680.png

 

</div><iframe frameborder="0" src="https://www.---/subjects/concessions/index.htm" style="max-width: 100%; width: 100%; height: 550px; margin-left: auto; margin-right: auto;"></iframe>

 

Categories:
  • Niktia Polyakov Microsoft Profile Picture
    Microsoft Employee on at

    That's more about the content inside of the iFrame, not sure you are meant to modify the content inside of iFrame

     

    Mayby someone stronger in web-front-end coding can help, but generally undertain what you are doing is common place...in fact key learning I relay when people want to build a Portal to be used inside of iFrame is they should consier and design for that expereince from the start

  • Verified answer
    Christian Leverenz Profile Picture
    1,214 on at

    Hi @Phineas ,

    we are also using portal pages within iframes, especially when embedding knowledge base articles or suppourt requests into exiting sites of customers.

    As @NikitaPolyakov said, it depends a little bit on what you want to achieve. Basically you have some options:

    • set up a page which does not use header and footer (set in the page template). The challenge on that one is, that you get a plain html page and have to do everything on your own.
    • usually, you do not need the navigation in iframes, so basically you could hide the navigation by jQuery. The actual selection of the element depends on your specific header template.

    additonally, i usally introduce a small script in the iframe and the embedding page to resize the igrame besed on its size needs.

    So, in the iframe i have code like:

    var sendsize = function() {
              window.parent.postMessage('{ "message":"resizefromserviceportaliframe" , "scrollHeight":' + document.body.scrollHeight + ',"scrollWidth":' + document.body.scrollWidth + '}',"*");
            }
            $(window).resize(sendsize);
            sendsize();
    which sends the actual size to the hosting window (yes, a pedestrian json, i know 🙂 ) and the hostingwindow has a listener which decodes the message and sets the size of the iframe accordingly.
    Hope this helps pointing in a solutiondirection,
      Christian
     
    PS it could be that you have to enable portals to be allowed to be displayed in iframes and/or the hosting site  to enable content from other domains by sending the corresponding csp-headers (see here: https://docs.microsoft.com/en-us/powerapps/maker/portals/configure/cors-support (especially HTTP/Content-Security-Policy) for details).

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
Mohsin Ali Profile Picture

Mohsin Ali 35

#2
M Bilal Khan Profile Picture

M Bilal Khan 29

#3
11manish Profile Picture

11manish 21 Super User 2026 Season 2

Last 30 days Overall leaderboard