Is it just me, or does the viewport-fit=cover feature not seem to function properly on

My goal is to have my website fill the screen on both sides when in landscape mode on IOS Safari, but I haven't found a solution that works.

I've included the following meta tag:

<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
, and also added:

@supports(padding:max(0px)) {
    body, header, footer {
        padding-left: min(0vmin, env(safe-area-inset-left));
        padding-right: min(0vmin, env(safe-area-inset-right));
    }
}

I've noticed that changing the background color of the body tag works, but I need my background images to fill the space.

Does anyone have any ideas or solutions?

UPDATE:

Here is a screenshot illustrating the issue: https://i.sstatic.net/Ga73L.jpg

Below is the CSS code:

div.et_pb_section.et_pb_section_6 {
    background-position: center top;
    background-image: url(https://XXXXXX.com/wp-content/uploads/2023/05/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="d4b3a6b5a4bcbdb7f9a4b5a0a0b1a6ba94e6acfaa4bab3">[email protected]</a>),linear-gradient(180deg,#80b6d7 0%,#d2c5de 100%)!important;
}

Answer №1

Setting viewport-fit=cover works well in my experience, except when executed as a snippet. The desired outcome may not be visible when running the snippet on an iPhone. (It appears that snippets have limitations – even if displayed in full page mode, they are still contained within an iframe, thus restricting the scope of the meta tag to that iframe.)

Nevertheless, give this link a try as it contains essentially the same code as the snippet, and you will notice that the image correctly fills around the notch area when the phone is in landscape orientation.

body {
  background-image: url(https://picsum.photos/id/237/1000);
  background-size: cover;
  background-position: center;
  height: 100svh;
}
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">

Answer №2

After some investigation, I managed to pinpoint the issue. It turned out that there were two conflicting meta tags named viewport in my parent theme. By replacing the function in the child theme, I was able to resolve the conflict.

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

Managing the appearance of one DOM element using another DOM element

Hey there, I'm currently working on an Angular Material tooltip implementation. When I hover over my span element, the tooltip appears. Now, I'm wondering how I can dynamically change the background color of the tooltip based on certain condition ...

Angular is not displaying the data from the dynamically injected component in the main component

I have encountered an issue where I am attempting to showcase a component's HTML view within another component in a chatbot scenario. Let's refer to them as the chat component and component 2. Essentially, the chat component – responsible for r ...

The NWjs iteration of Bad Time Simulator is having trouble playing background music

Recently, I came across an interesting online game and decided to try my hand at modding it. However, I faced challenges while modifying the source code on Github - the pages took too long to load and my browser cache seemed impossible to clear. In a ...

The image slideshow on W3 Schools displays images in a stacked formation

Utilizing this code snippet from W3 Schools to incorporate an image slideshow into my web project. However, upon page load/reload, the images appear stacked vertically rather than horizontally (one above and one below). The slideshow functions properly aft ...

Tips for monitoring AVCaptureDevice.isTorchActive

I am trying to monitor the status of a flashlight and adjust the tintColor of a button, but it seems that the observeValue method is not being triggered. Can someone please help me figure out what I am doing wrong? ViewController.swift import UIKit impor ...

Tips for creating a connecting line between two elements

I am currently working on developing a tree-like structure. I have successfully created numbers within circles using HTML badges. However, I am facing difficulty in drawing lines connecting one element to another. I attempted using left and right diagonal ...

PHP is only outputting a single row

I am struggling with selecting and printing multiple users from the database. It seems to only print one user at a time, when I have 10 users that need to be displayed. <?php session_start(); $currentgroup = $_SESSION['groupname'] ...

In Chrome browser, the orientation of the options in the datalist remains consistent

Is there a way to change the direction of the datalist's options to RTL? While I'm able to change the direction of the input element, the same doesn't apply to the options of the datalist. I've attempted setting the dir attribute to r ...

Several target elements on a single page

I am currently facing a problem with maintaining the active state of one anchor tag's target while clicking another button within the main identifier. Upon clicking the INTEL button, its opacity changes from 0 to 1. However, upon clicking Data Histor ...

Markdown automatically converts Jekyll YAML front-matter into an <hr> tag

My Jekyll YAML header information is not being parsed correctly by the GitHub Pages server. The Markdown file for my blog located under _posts is titled 2014-08-28-just-build-my-blog-site.md, and it looks like this: --- layout: post title: just build my b ...

Exploring Swift 3 capabilities: effortlessly showcase the JSON data stored within arrays

Facing a challenge while dealing with JSON data in Swift3. I have managed to retrieve all the data except for the street key-value pair which should be considered as an array or dictionary. Struggling to understand how to extract the data for this particu ...

Store user inputs from HTML forms into database using Javascript

I'm looking for assistance on how to store this javascript/html form data in a database. My expertise lies in connecting html/php with SQL, and I need guidance on integrating this form submission process. Below is the code snippet that enables users ...

Mastering the implementation of UISearchBar with Core Data

I am currently working on an iPad app using Xcode 4.6, iOS 6.2, ARC, and Storyboards. The app includes a UITableView with prototype cells containing two labels (lName and lPhone). I have populated a NSArray with data from the Core Data store. While I ini ...

Unable to conceal my DIV element using JavaScript

This is a custom DIV for showcasing content <div id="MyUniqueDiv"> <div class="fa_close"><a href="#" onclick="hFa()"><img src="custom/close1.jpg" /></a></div> <h1><i>THIS WEEK'S CONTENT</i> ...

The jsonGenerator is unable to process strings containing spaces

Hey, I'm having trouble passing a string with whitespaces to my JavaScript function using jsonGenerator. Here's the code snippet: jGenerator.writeStringField(cols[8], ap.getContentId() != null ? "<img src='img/active.png' onclick=au ...

Discover the power of using SVG sprites in Vue JS for dynamic, visually appealing CSS background

Utilizing an SVG sprite file in a Vue JS HTML template is successful with the following setup: <svg class="icon"> <use xlink:href="~@/assets/images/icons.svg#edit"></use> </svg> The contents of the icons.svg file typically resem ...

Nesting functionality in TailwindCSS is currently experiencing issues when used in conjunction with tailwindcss/nesting or postcss

PostCSS Configuration module.exports = { plugins: { "postcss-import": {}, "tailwindcss/nesting": {}, tailwindcss: {}, autoprefixer: {}, }, }; Global CSS Styles .form-control { @apply w-full px-3; & p { @ ...

When using CSS column-fill auto, the printed page breaks are disregarded

The column-fill:auto property functions by filling one complete column before moving on to the next. .two-column { column-count: 2; column-fill: auto; } In Chrome, this behavior is consistent while viewing on screen, but when printing and encounterin ...

The image appears smaller than its actual size

I'm having an issue with an image control that is supposed to display a logo on my webpage. The image itself is 500 x 500 pixels, however, when it appears on the screen, the control automatically shrinks it down to 19x20. I've been struggling to ...

Persistent white line in flexbox item that refuses to disappear

https://i.sstatic.net/BKHZV.png I’m struggling to find a solution for the white line issue on the image. If anyone can explain why this is happening, I would greatly appreciate it. Despite my attempts, I have been unable to remove it even after inspecti ...