Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Histos
New Member

Fullscreen button. iFrame responsive for mobiles?

Hello,

I have 2 issues in my embedded Power BI report in my wordpress website:
(Both things I comment you can find it in the report I've done here: https://historich.net/pandemias-en-la-historia/ )

1# iframe is not responsive. (here I share my solution)

I guess this is not a Power BI issue, but is interesting for anyone who use Power BI embedded, the thing is that the height of the iframe is not responsive, and if you want a balanced width/high in desktop version, it won't look good in mobile.
So what I did is make it responsive with an embed-container and easy (copy/paste) css. Here I share u my HTML code:

 

 

 

 

<div class="embed-container">
<iframe src="your own URL" frameborder="0" allowfullscreen="" webkitallowfullscreen="true" mozallowfullscreen="true" oallowfullscreen="true" msallowfullscreen="true"></iframe>
</div>

 

 

 

 


And here is the CSS:

 

 

 

 

.embed-container {
position: relative;
padding-bottom: 70.75%;
height: 0;
overflow: hidden;
}
.embed-container iframe {
position: absolute;
top:0;
left: 0;
width: 100%;
height: 100%;
}

 

 

 

 


2# Fullscreen Button in mobile version

Here my problem is that the button where we can see the report in fullscreen, it desappears when you open the web in the mobile (but it appears if you view it in desktop version in the mobile).
Thats an important thing cause the reports can only be enjoyed in fullscreen mode specially in cellphones (until is available the mobile view).
My little solution (but I think is not perfect) is to ad a link under the iframe that brings you to the report, and then you can see the fullscreen button. But its bit confusing.

Both issues I told, you can find it here and see how it looks in a report about all the pandemics and epidemics through the history.

https://historich.net/pandemias-en-la-historia/

 

Any other comment will help, thank you.

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @Histos ,

In order to make your embedded iframe responsive, you need to wrap the iframe in a div and apply inline css. Follow these simple steps:

  1. Get the iframe embed code and paste in into your HTML page.
  2. Set the height and the width attributes of the iframe tag to 100%
  3. Change the CSS position of the iframe tag to 'absolute' and set the left and top CSS parameters to '0'
  4. Add a div container around the iframe tag as it is shown by the following sample code. The value of the 'padding-bottom' parameter is based on the aspect ratio of the content (in case of a 16:9 video the calculation is 9/16 = 0.5625)

Your final html code should look similar to the below:

 <div id="Container"
     style="padding-bottom:56.25%; position:relative; display:block; width: 100%">
     <iframe id="ViostreamIframe" width="100%" height="100%" src="https://publish.viostream.com/player/iframe/s0m3m3d14?playerKey=s0m3p14y3r" frameborder="0" allowfullscreen="" style="position:absolute; top:0; left: 0"></iframe>
</div>

refer: https://help.viostream.com/frequently-asked-questions/how-do-i-make-an-iframe-embed-responsive 

And about  Fullscreen Button in mobile version,refer:

https://developers.google.com/web/fundamentals/native-hardware/fullscreen 

 

Best Regards

Lucien

View solution in original post

1 REPLY 1
v-luwang-msft
Community Support
Community Support

Hi @Histos ,

In order to make your embedded iframe responsive, you need to wrap the iframe in a div and apply inline css. Follow these simple steps:

  1. Get the iframe embed code and paste in into your HTML page.
  2. Set the height and the width attributes of the iframe tag to 100%
  3. Change the CSS position of the iframe tag to 'absolute' and set the left and top CSS parameters to '0'
  4. Add a div container around the iframe tag as it is shown by the following sample code. The value of the 'padding-bottom' parameter is based on the aspect ratio of the content (in case of a 16:9 video the calculation is 9/16 = 0.5625)

Your final html code should look similar to the below:

 <div id="Container"
     style="padding-bottom:56.25%; position:relative; display:block; width: 100%">
     <iframe id="ViostreamIframe" width="100%" height="100%" src="https://publish.viostream.com/player/iframe/s0m3m3d14?playerKey=s0m3p14y3r" frameborder="0" allowfullscreen="" style="position:absolute; top:0; left: 0"></iframe>
</div>

refer: https://help.viostream.com/frequently-asked-questions/how-do-i-make-an-iframe-embed-responsive 

And about  Fullscreen Button in mobile version,refer:

https://developers.google.com/web/fundamentals/native-hardware/fullscreen 

 

Best Regards

Lucien

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.