Mobile-responsive iFrame content is designed to adjust and fit appropriately on

While my iframe is responsive on both mobile and website, I am facing an issue where the content overflows (both overflow X and Y) from the width and height of the iFrame.

Here's the scenario: in the mobile view (simulated using Google Chrome to mimic display on Galaxy Note 3, Pixel, Nexus 7 etc)

https://i.stack.imgur.com/KbiTG.jpg

And here's how it should appear in the web view https://i.stack.imgur.com/jjD81.jpg

As you can see, the content is overflowing. As an Android Engineer, I'm not a frontend expert.

I have tried two solutions to make my iframe responsive:

Firstly, by wrapping it in this style:

<style>
    .responsive-video {
        position: relative;
        padding-bottom: 56.25%;
        padding-top: 60px; 
        overflow: hidden;
    }

    .responsive-video iframe,
    .responsive-video object,
    .responsive-video embed {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    iframe {
        width:400px;
        height:600px;
        overflow-x:hidden;
        overflow-y:hidden;
    }
</style>

<div class="responsive-video">
    <iframe src="http://localhost/html/media/html_games/test_games"></iframe>
</div>

Secondly, by using Bootstrap:

<div class="embed-responsive embed-responsive-4by3">
    <iframe class="embed-responsive-item" src="http://localhost/html/media/html_games/test_games"></iframe>
</div>

Both solutions make the iframe responsive on mobile and web, but not the content itself. Can someone please advise on how to make the content responsive so that mobile users don't need to scroll on the Y-axis like in the first screenshot?

.resp-container {
            position: relative;
            overflow: hidden;
            padding-top: 56.25%;
        }

.resp-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
<div class="resp-container">
        <iframe class="resp-iframe" src="https://dev-wma-051-ccwuh3zg.qreatiq.net/media/html_games/fbibekasi_games1513/" allowfullscreen></iframe>
    </div>

The above snippet code works fine on a browser but overflows content when viewed on mobile devices such as the Galaxy Note3 or Pixel 2.

When viewed on mobile, I have to scroll to see all the content. How can I make the content fit within the iframe? https://i.stack.imgur.com/uj78S.png

Answer №1

After analyzing the code, it appears that the issue lies within the

 iframe tag. One potential solution is to include <code>overflow:hidden
or adjust the zoom settings.

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

Using jQuery UI to dynamically add a widget based on a specific class, rather than relying on

Exploring the world of Apache Cordova and jQueryUI is a new adventure for me. I am currently experimenting with formatting the layout of my index.html using jQueryUI. As mentioned in this section of the jQueryUI tutorial, a widget can be added using the f ...

Enable users to choose multiple rows at once or alternatively choose by checking the checkboxes

When using Tabulator with the setting table.selectable = true, any cell click selects the row. However, I specifically want rows to be selected only via checkboxes, so I set selectable = false. The issue now is that the checkboxes behave like a radio butt ...

Tips for creating a dynamic header background using custom CSS for my website design

As I embark on creating my very first WordPress website using the Blossom Pin Pro theme, I'm encountering an issue where the background image of the header disappears when adjusting the window width. Click here to visit the site If you have a code s ...

Maintain the expanded sub-menu when the mouse leaves the area, but a sub-option has been

Implementing a side menu with parent and child options that dynamically display content in the main div on the right when a child option is selected. The parent options are initially shown upon page load, and the child options appear when the mouse hovers ...

What is the best way to create a responsive navigation bar design?

I'm trying to create a unique navigation bar that features a hexagon-shaped logo and 3 buttons aligned in a specific way. Check out the screenshot for reference here. Although I've managed to align everything perfectly on a fullscreen (1920x1080 ...

The dropdown menu is being filled with 'undefined' values when using AJAX as the data source in Typeahead

I've been trying to implement typeahead functionality, but I can't seem to find a solution on Stack Overflow that works for me. I am using an ajax source to retrieve JSON data for my products, however the typeahead feature is returning all matche ...

Unusual Blank Space in HTML CSS Design

While working on my website, I noticed a peculiar white space appearing at the bottom of the page, but only when using Internet Explorer. Safari looks fine. I am currently using IE8. I would like the white background to end after the black navigation link ...

`Unveil the hidden edges of the Google timeline chart`

Does anyone know how to remove the chart border from a Google timeline chart using this script? <script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script> <script type="text/javascript"> google.charts.load ...

Issues arise with the functionalities of FireFox related to transformations and transitions

I've been working on my CSS and here is what I have: img.buttonImg { -webkit-transition: all 0.5s ease-in-out; -moz-transition: all 0.5s ease-in-out; -o-transition: all 0.5s ease-in-out; -ms-transition: all 0.5s ease-in-out; transition: ...

Preloading videos for optimal performance on mobile devices

Looking for a solution where 4 MP4/video files, each 5MB in size, can be played consecutively without gaps between them on all browsers and devices. Preferably not looking for a solution involving the replacement of video source files. The current approac ...

Steps to define a JavaScript mixin in VueJS

Currently, I am working on a Vue project with TypeScript and in need of using a mixin from a third-party library written in JavaScript. How can I create a .d.ts file to help TypeScript recognize the functions defined in the mixin? I have attempted the fol ...

Monitor the completion status of all Ajax requests using only JavaScript

I am aware of the ajaxStop method in jQuery. $(document).ajaxStop(function() { //Do something }); If jQuery is not available, is there a way to achieve this with pure JavaScript instead? If so, could you please provide an example? Thanks ...

Chrome on IOS: Experiencing screen freezing while scrolling

1) I'm working with Material UI in React JS. I have added a simple scrollable code, but when I reach the bottom of the screen/scroll, it freezes. 2) I also tried it with a simple HTML page and it worked correctly. <div style={{ ...

Navigating Google GeoChart Tooltips using Google Spreadsheet Data

My objective is to create a custom GeoChart for the company's website that will display data specific to each state in the US region based on team member assignments. The GeoChart should color states according to which team member helps that state&apo ...

My goal is to dynamically adjust the height of this section based on its content

I experimented with this code snippet: <section class="unique"> <div class="this d-flex pt-5"> <div class="leftside2 w-50 h-100"> <img src="images/twowomen.jpg" alt=" ...

Python's website scraping: How can I determine the correct reference points in the html structure?

As a novice in the world of programming, I have mainly worked on simple Python projects. Recently, I embarked on a project to create a web scraper using Python with bs4 to extract success stories from a website. These success stories are neatly organized w ...

Is there a way to disregard the data returned from previous AJAX calls?

I've been wondering about a strategy for managing delayed AJAX data returns in a scenario where newer calls should take precedence over earlier ones. For instance, if a first data fetch initiated at 12:01:33 is delayed and comes back at 12:01;39, whil ...

What is the best way to select a specific value from JSON (Webhook) Data?

I am looking for a way to extract and store a specific value from a JSON data into a variable. Specifically, I want to save the value of Name (John) in a variable like this: var name = "". I attempted using var name = data.Name but it is not wor ...

Creating a compilation of material-ui using browserify

I am currently in the process of incorporating material-ui (material-ui.com) JavaScript into my project to utilize its React components. To streamline this process, I have been utilizing browserify to consolidate all the JavaScript files into a single one ...

Proper method for adding elements in d3.js

I have a block of code that selects an #id and appends a svg-element into it: var graph = d3.select(elemId).append("svg") .attr('width', '100%') .attr('height', '100%') .append('g') Within th ...