Tips for adjusting the height of an iframe to ensure that all content is responsive and contained within a div set to 40% height

I am having issues with setting the height of an iframe that displays a PowerBI dashboard.

My specific requirements are:

  1. The content within the iframe should be contained within a div that has a height of 40% and sets all its contents to a height of 100%.

Below is a screenshot illustrating what I am trying to achieve:

View image here

I have attempted to adjust the height of the parent elements without success. Any assistance would be greatly appreciated.

async showDashboard(rpConfig: IDashboardEmbedConfiguration) {
    let powerbi = new pbi.service.Service(pbi.factories.hpmFactory, pbi.factories.wpmpFactory, pbi.factories.routerFactory); 
    let dashboardContainer = <HTMLElement>document.getElementById('dashboardContainer');

      powerbi.reset(dashboardContainer)
    
    console.log(rpConfig)
      let dashboard = powerbi.embed(dashboardContainer, rpConfig)
      console.log(dashboard)
      // this.dashboardConfig = {}

      this.loadedDashboard = true;
    }
  }
.row2{
    height: 40%;
    .tabContainer{
      height: 100%;
      background-color: #fff;
      .powerBiBlock{
        height: 100%;
        .dashboardContainer{
          height: 100%;
          .iframe{
            height: 50%;
            //overflow-y: hidden;
          }
        }
      }
    }
  }
<div class="row2" id="ButtonEl">
    <div class="tabContainer">
      <div class="margin50">
        <div class="top-tab btn btn-primary" (click)="toggle()">
          <p><i class="arrow down"></i></p>
        </div>
      </div>
      <div class="powerBiBlock">
        <div id="dashboardContainer" class="dashboardContainer">
          <div id="dashboardContainer" class="dashboardContainer"></div>
        </div>            
      </div>
    </div>
  </div>

Answer №1

    
.dashboardContainer > iframe{
    height: 40% !important;
          }

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Switching back and forth between two CSS animations using Jquery

I am working on creating a unique pendulum system using 3 balls. After successfully creating the balls and animating them, I am faced with a challenge in making the animation continuous. Here is my code: .circle { width:30px; height:30px; backgrou ...

"Optimize Magellan Sidebar for Mobile Devices by Relocating it to the Bottom of the Page

After spending a week working with Foundation 5 framework, I'm curious if there is a straightforward way to make my magellan sidebar shift to the bottom of the page when viewed on mobile or tablets. <div data-magellan-expedition="fixed"> <di ...

Slowly rendering spinner in Google Chrome using jQuery

When I click a button, I want to display a spinner to indicate that the browser is processing actions in the background. Interestingly, the spinner appears immediately after clicking the button on Firefox, but there is an 8-second delay before it shows up ...

Why does this CSS ticker only display the first four posts?

Hello, I'm interested in adding a News Ticker to my Rails application. I came across this CSS ticker: I'm facing an issue where it only displays the first four posts. I believe the problem might not be with my data retrieval using the .each loop ...

Having trouble retrieving accurate text information from a JavaScript link

I am encountering an issue with my code which consists of links with divs inside them. When I click on a link, it should display another div with data for "Case No" and "Type". However, the problem is that it only fetches the data from the first link click ...

Unable to play GSM extension files on a web browser due to compatibility issues

I've been attempting to play an audio file with a (.gsm) extension using <audio>, object tags, and JavaScript. <script> var myAudio = new Audio(); // creating the audio object myAudio.src = "test.gsm"; // assigning the audio file t ...

Using VueJS to showcase user input in a dynamic list and a pop-up modal

I am attempting to achieve the following: Use a v-for loop to display form input (name, position, company) as an unordered list, showing only the name input and a button for each person When a button is clicked, a modal will appear displaying all the data ...

What You See Is What You Get - A versatile tool for editing both text and

As a developer, I have encountered a common need that StackOverflow addresses. Situation I am in the process of creating a website where users can post code examples and articles using an admin system. These posts may be created by me or registered fron ...

Having trouble with CSS box alignment issues in the top margin

I am working on customizing a CSS box for a navigation menu. Here is the current CSS code: .navigation-div { text-align:right; margin-top:14px; box-shadow:0px 0px 10px rgba(0,0,0,0.47); padding: 0; color:#E3E3E3; background-color: ...

What is more effective: generating/eradicating HTML components or concealing them until required?

When it comes to showing/hiding content, there are two main approaches that I would consider: Creating and destroying elements as needed using jQuery's append() and remove() methods. Having all elements already in the HTML but hiding/disabling them ...

JavaScript generated form fails to submit

I am currently facing an issue with submitting form data to a PHP file when it is generated using JavaScript. I am unsure of how to resolve this problem. The form submission works fine on a test .html file by itself, but not when it is generated by JavaScr ...

Three.js - The initial child leaps into action and inherits the parent's transformations

I am currently working on establishing a parent/child hierarchy involving three objects using the ".add()" method in Three.js. When parenting two objects, everything works smoothly. However, I encountered an issue when trying to create a hierarchy with thr ...

Center text in form-control items on Bootstrap 3 grids

Can you provide guidance on achieving proper alignment of inputs and labels across bootstrap grids? I am looking to ensure that the labels are positioned exactly the same as the first column. Please refer to my plunk: http://plnkr.co/edit/jaMAp38Rr1g7BLW ...

Connecting NGINX to a Node.js cluster with proxy_pass

After setting up both a NGINX server and a node.js process, the node.js code structure is as follows: function initiateCluster() { var numCPUs = require('os').cpus().length; if (cluster.isMaster) { // Fork workers. for (var i = 0; i ...

How can we trigger the Skill bar effect upon scrolling to the section?

I have created a stunning Skill Bar that is functioning perfectly. However, I am looking to enhance the experience by having the skill bar effect trigger only when I scroll to that specific section. For example, as I navigate from the introduction section ...

I am interested in incorporating a captcha system using ajax

Recently, I implemented email and captcha validation in a form. Now, I am looking to make some modifications. Specifically, I want the form to not reload the page if the captcha is incorrect or left empty. This means that all fields that have already bee ...

Extract information from various files stored in Firestore

I have been struggling to retrieve data from multiple documents despite numerous attempts. The screenshot below displays that I have a collection of 3 documents, and my inquiry is how to extract data from each of them. https://i.stack.imgur.com/bFrIG.png ...

Error encountered after attempting to save with incorrect configuration settings for the resource

A portion of my code involves a service module that sends data using the POST method: //services.js var myServices = angular.module('myServices', ['ngResource']); myServices.factory('User', ['$resource', function($ ...

I believe it's just basic jQuery with parents

I am having trouble figuring out how to move the class .inner separately in the USPs! Can someone please explain how this can be achieved? Any suggestions on how to solve this issue? HTML <div class="usps"> <div class="dienst"> & ...

Troubleshooting an issue when trying to call a PHP function in jQuery Ajax that is

Having trouble with include statements in my PHP files. When the page loads initially and then gets loaded again through jQuery ajax calls, I encounter an error with my include statements. I have a main page that includes a PHP script like this: <div i ...