The height of the banner is specific to the iPad and not based on the device

Visit my website here

After testing my site on various devices such as desktop Chrome, Android, Samsung tablet, iPhone 6, and iPad, I noticed that the banner doesn't quite work well on iOS, particularly on the iPad. The height of the banner becomes overly large and does not match the device's screen height.

I'm struggling to pinpoint where in the code the issue lies, but ideally I would like the banner to adjust its height dynamically to match the window size on all devices - if I used that term correctly.

The code for my banner is based on this article Responsive Height/Width Video Header

Here is the code snippet I am currently using:

#banner.container-fluid {
    padding: 0;
    position: relative;
}
#banner.overlay:after {
    position: absolute;
    content:" ";
    top:0;
    left:0;
    width:100%;
    height:100%;
    display: block;
    z-index:0;
    background-color: rgba(0,0,0,0.8);
}
header {
    position: relative;
    overflow: hidden;
    width:100vw;
    height:100vh;
    max-height:100vh;
    text-align:center;
}
.banner-text {
    position: relative;
    top: 55%;
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    -o-transform: translateY(-50%);
    transform: translateY(-50%);
    z-index: 1;
    margin: 0 auto;
    max-width: 550px;
}
.banner-text h1,
.banner-text h4 {
    color: #fff;
}
.banner-text h1 {
    padding-bottom: 20px;
}
.banner-text h4 {
    padding-bottom: 40px;
}
.banner-text .logo-white {
    width: 75px;
    height: 65px;
    display: block;
    margin: 0 auto 20px auto;
}
.video-holder {
    position:absolute;
    height:100%;
    width:200%;
    left:-50%;
}
video {
    position:absolute;
    top: -99999px;
    bottom: -99999px;
    left: -99999px;
    right: -99999px;
    margin: auto;
    min-height:100%;
    min-width:50%;
}

Answer №1

It appears that the Webkit team intentionally implemented this. A bug report was filed but has now been closed with a resolution of WONT FIX.

Potential Solution (not ideal)

@media all and (device-width: 768px) and (device-height: 1024px) and (orientation:portrait) {
  header { height: 62vh; }
} 

In my experimentation, I did not encounter the need to apply styles for landscape mode. However, my testing was done using an iPad simulator, so the results may differ on an actual iPad device.

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

Ways to incorporate an SVG file into an HTML canvas element while adjusting its dimensions on the fly

I'm struggling with implementing an SVG into my web-based game. I am attempting to draw the SVG, which has been encoded into a data URL, onto a canvas that should match the dimensions of the document window even when the window is resized. (functio ...

CSS Transition - Troubleshooting my malfunctioning code

I seem to be facing a simple issue with my code. The following snippet does not work in Chrome or Firefox, as the transition property is not working properly. Instead of smoothly transitioning from blue to red when hovered over, the element immediately swi ...

The ExpressJS EJS issue arises when trying to access a property that is undefined

I'm new to NodeJS and seeking assistance. I am working on a website where users can promote their virtual conferences for others to see. I have set up a form with the POST method, where the data gets pushed into an array and then displayed in an EJS f ...

When JSF renders bootstrap buttons, they appear without any horizontal padding

There is a strange behavior that I cannot explain... I am working with a series of buttons: <h:commandButton value="foo" actionListener="#{foo.foo}" styleClass="btn btn-danger"> <f:ajax render=":form"></f:ajax> </h:co ...

What methods can be used to test scss subclasses within an Angular environment?

Exploring different background colors in various environments is a task I want to undertake. The environments include bmw, audi, and vw, with each environment having its own unique background color. Need help writing an Angular test for this? How can I mod ...

"Step-by-step guide for incorporating a right-to-left (RTL) Bootstrap

Is there a way to make my bootstrap navbar right-to-left (RTL)? I want the logo to be on the right and the links to flow from right to left. I've tried various tricks but none of them seem to work. Here's the code I currently have: <nav class ...

Encountering an unexpected error of "Unexpectedly discovered two active proxied devices" in xcodebuild's DVT assertion

This issue has only just started occurring. The only action I took between it working properly and the error appearing was running ionic run ios. Here is the configuration details and the complete error output: Build settings from command line: ARCHS ...

Styling does not seem to apply to inner components in NEXTJS

I am attempting to create a ChatGPT replica using Next.js and Tailwind CSS. My focus is currently on the main chat screen, where each message is displayed using a separate Message component with its own styling. However, I am facing an issue where the styl ...

What is the best method for retrieving data from a database using PHP?

Currently, I am dealing with a specific issue regarding reading an auto-incremented value and utilizing it in my database. Here is the structure of my database: mysql_query("INSERT INTO category (category,image) VALUES ('$name','$default_ite ...

What is the best way to include Google Calendar in a div container while ensuring it is responsive?

I'm currently working on the layout of a website that features a slideshow of images at the top, followed by an embedded Google Calendar. I've encountered an issue with the responsiveness of the Google Calendar within its designated div container ...

Manipulate DOM elements by selecting the closest or nearest DIV and assigning a value to each input using jQuery

Within my application, I utilize $.get and Yahoo APIs to retrieve open graph/og: title & description from a specified URL provided by the user. This process can be seen in action below, or you can access the JSFiddle snippet. $('#get-social-data ...

What is the best way to design an in-app settings menu?

My goal is to design an in-app settings view similar to the image below: What are these elements referred to as? And what is the most effective method for creating app settings? I have come across several tutorials that focus on creating settings pages w ...

I require the xpath for a particular DOM element in order to accurately locate and interact with it using the Selenium web driver

My focus is on test automation with Selenium, specifically identifying elements using Xpath. The HTML structure I am working with looks like this: <p class="ng-binding"> <span class="ng-binding">Patrik</span> Thomson </p> I am lo ...

Utilizing Angular controllers to access data attribute values from child elements

Today I embarked on the journey of learning AngularJs through online tutorials. Excited about my new project, I started working on creating some useful features using Angular. Here is a snippet of my progress so far: The HTML Part <div data-ng-control ...

iOS experiences a lag in loading dynamic images

I have created a unique jquery carousel specifically designed for mobile devices. It features three containers that display three images at a time, with jquery handling the animation. By detecting the user's swipe direction (left or right), I update t ...

Difficulty displaying background image when using negative top margin in Firefox

My website includes a scrolling image section with background images (not img tags) that are positioned using top-margin: -28px; to ensure they appear below a part of the header. Everything looks perfect on Safari and Chrome, but in Firefox, the top 28px o ...

Can cards be designed with a color gradient background using a radial gradient?

I'm trying to create a card with a gradient background color. Expected: I want the background color to be a gradient (like the green color behind the image) https://i.sstatic.net/ujiuz.png Actual: Currently, the background color is not a gradient an ...

File access notifications for iOS and Android devices

I am searching for a solution that can send push notifications to users of my mobile app whenever they share a file, such as a video or PDF. Here's how it should work: User Ann opens my app The app displays a list of videos and PDFs Ann can share a ...

Bootstrap-tour is incompatible with a row within a table structure

Is there a way to highlight a table row effectively? I've been struggling with it and tried using the fix mentioned in this bootstrap-tour issue here Check out this demonstration on jsFiddle: jsFiddle JAVASCRIPT $("#dialog").dialog(); var t = new ...

Organizing CKRecord results in the occurrence of 'Anticipated Varieties'

Can someone explain why this code is returning Expected Types on the $1 symbol? private func sorting(records: [CKRecord]) -> [CKRecord] { if ascendingSorting { return records.sorted { $0.value(forKey: "name") as! String < $1. ...