iOS 7.1's sleek user interface is creating issues with the viewport height CSS unit (vh) in web design

Ever noticed how the viewport size changes when scrolling down a page in iOS 7.1? But even though the viewport changes, 100vh doesn't update. Is there a way to prevent the minimal UI or update the viewport on scroll?

Check out an example site here.

Take a look at the picture below showing the issue and another one displaying how it should appear.

Answer №1

In order for the minimal UI to activate, the scrolling element must be set as 'body'.

To achieve this, wrap your content in a div with overflow: auto and adjust your body's overflow to visible. Ensure that both the body and the div have their heights and widths set to 100%.

Your CSS code should resemble the following:


body {
    width: 100%;
    height: 100%;
    overflow: visible;
}

#container {
    width: 100%;
    height: 100%;
    overflow: auto;
}

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

A step-by-step guide on accessing and displaying local Storage JSON data in the index.html file of an Angular project, showcasing it on the

I am facing an issue with reading JSON data from localStorage in my Angular index.html file and displaying it when viewing the page source. Below is the code I have attempted: Please note that when checking the View page source, only plain HTML is being ...

Looking for a way to locate words enclosed in square brackets and change them into dynamic URLs using PHP?

In my quest to locate words enclosed in square brackets, such as [word], and form a dynamic URL, I encountered a challenge. Although I attempted using the str_replace() function to identify the word, it resulted in generating links in this format: <a ...

Autosuggest Feature in Google Maps

Can someone please help me with customizing the width of the input text box and drop down menu using this resource: https://developers.google.com/maps/documentation/javascript/places#places_autocomplete? I'm having trouble figuring it out. ...

What is the best way to incorporate tooltips in SVG?

My teacher wants me to display a tooltip on an SVG circle with links and information when we hover over it. They suggested using jQuery UI, but I've done extensive research and nothing has been able to assist me so far. ...

organizing the elements in the list into a visually appealing layout

I am currently working on transforming table data into a pivot format and presenting it in a horizontal list. My goal is to ensure the design is responsive enough to be viewed on mobile devices as well. Below you can find the CSS code I have implemented fo ...

Is it possible to apply Mat-card to an Anchor Element?

How can I make a mat-card clickable and show a link cursor when hovered over? I have multiple cards and when I click on one, I want to navigate to another page. What is the best way to achieve this? Is it acceptable to use the following code in my templat ...

What is the best way to ensure my checkboxes are positioned on individual lines?

I am trying to vertically align my checkboxes so that each option appears on a separate line. I searched online and found suggestions to use vertical-align: middle, but that only changes the position of the label. I want each checkbox to be displayed on it ...

How to bypass validation for required input in jQuery validate plugin

As an example, consider the <input name="surname" id="surname" type="text">. Sometimes I want to hide this input and make it non-required. My current workaround is to set a value such as "some value" when hiding the input, and then remove this value ...

Arranging div elements in a vertical stack with CSS

Looking for help in arranging div elements in a way that they resemble an equalizer, similar to the one shown in this screenshot Equalizer. Can you provide advice on how to remove the dots from the list? I've already attempted using the CSS property ( ...

jQuery checkbox toggles multiple divs instead of targeting specific ones

I have set up my page to display divs containing posts using a specific format. The divs are structured as follows (replacing # with the postID from my database): <div id="post_#> <div id="post_#_inside"> <div id="like_#"> ...

My redirect is being disrupted by passing a text string with new lines through GET requests

My issue involves submitting a form that utilizes JavaScript to pass a value through GET. Upon reaching the submission page, the function runs successfully, but when redirecting via the header, it ends up on a blank page. The header code for redirection lo ...

Stop the page from automatically scrolling to the top when the background changes

Recently, I've been experimenting with multiple div layers that have background images. I figured out a way to change the background image using the following code snippet: $("#button").click(function() { $('#div1').css("background-image ...

Guidelines for choosing input using jQuery

I am looking to retrieve the value of an input using jQuery. Specifically, I need to extract the value of a hidden input with name="picture" when the user clicks on the حذف این بخش button by triggering the function deleteDefaultSection( ...

What is the best way to remove the underline in Material-UI while still keeping the selection feature intact in Autocomplete?

Seeking to develop an Autocomplete feature with the TextField component while eliminating the underline. I successfully disabled the underline by utilizing InputProps={{ disableUnderline: true }} in the TextField properties, however, it also eliminated t ...

A single background image divided among two separate divs

Seeking help once again after encountering difficulties the first time. Any feedback is greatly appreciated. I am currently working on a website that includes 2 divs with background images, but I'm struggling to make them align perfectly across all d ...

The Django framework does not apply color to the Bootstrap Navbar as expected

I'm currently working on building an E-Commerce Website using Django. I have implemented a Bootstrap navbar, but the CSS styles that I obtained from this source are not functioning properly when placed within the {%block css %} tag. I have attached t ...

CSS not aligning email header correctly

I have been given the task of coding an HTML email for mailing campaigns. I have managed to get everything working, except for a particular piece of code. What I am trying to accomplish is having an image with other elements on top such as titles, a button ...

Searching for a particular string, selector, or XPath on numerous web pages using the "inspect element" browser tool - what is the best approach?

Hey everyone, I hope you're all having a fantastic day. I'm wondering, is there a way to search for an element across multiple web pages simultaneously, rather than just one page at a time? The goal is to locate a specific string or code (like ...

When a page is loaded, CSS and images fail to load initially but successfully load upon refreshing the page

Hey everyone, I've set up a PHP MVC application with the following structure: helloworld - application - configs - controllers - models - layouts - include - library - public - .htaccess - index.php - design ...

Get rid of any empty space in the image preview icon

Is there a way to eliminate the white space that appears when mixing landscape and portrait images? I want the images to move up and fill the space, even if they don't align perfectly. Additionally, I would like the images to resize based on the scal ...