Split screen on iPad is detrimental to the user experience of my website

I have developed a responsive website using CSS with media queries. Upon testing it on various devices, I noticed an issue with the iPad split screen feature. When the screen is split with a ratio of 3:1 and my website is opened in the smaller area, it displays the larger media query designed for iPads rather than the window size. Interestingly, the same issue does not occur on iPhones where it appears correctly in the smaller split-screen.

Below is an example of the code structure:

@media only screen and (min-device-width: 1100px) {
  #icons {
    width: 1024px;
  }
}
@media only screen and (max-device-width: 797px) {
  html,
  body {
    min-width: 150px;
  }
}
@media only screen and (max-device-width: 730px) and (min-device-width: 450px) {
  .icons {
    margin-left: 12%;
  }
}
@media only screen and (max-device-width: 450px) and (min-device-width: 390px) {
  .icons {
    margin-left: 15%;
    width: 14%;
  }
}
@media only screen and (max-device-width: 390px) and (min-device-width: 291px) {
  .icons {
    margin-left: 9%;
    width: 23%;
  }
}

Answer №1

It's more effective to utilize max-width over max-device-width since the latter pertains to the device size rather than the browser window. The same principle applies to min-device-width as well.

Answer №2

After some troubleshooting, I was able to solve the issue. The problem arose from

@media only screen and (max-device-width: ...) and (min-device-width:...)

The code was reading the device width instead of the current viewport width, causing the issue. I fixed it by replacing it with max-width (hopefully without breaking anything else)

@media only screen and (max-width: ...) and (min-width:...)

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 to Retrieve Check Box Labels and Populate Them into Textboxes

I would like to display the name of the selected checkbox label in a textbox. If multiple checkboxes are selected, I want their labels to be separated by commas and displayed in the textbox. Please excuse my poor English. $(document).ready(function() { ...

The drop-down menu is misaligned from its designated position underneath the title

Trying to incorporate a dropdown menu into my website, I am structuring the HTML as follows: <ul class="topnav"> <li> SECTION TITLE <ul class="subnav"> <li>One</li> <li>Two</li> ...

Subscribe on Footer triggers automatic scrolling to the bottom of the page

Whenever I fill out the form in the footer and hit submit, it directs me to a different page while automatically scrolling back down to the footer. I'm looking for a solution that prevents this automatic scrolling. I've attempted using window.sc ...

Enhancing VueDraggable (sortable.js) with drag out feature

I am currently utilizing VueDraggable for effortless and efficient sorting of elements. However, I am in need of a feature that detects when a dragged element leaves its parent so that a particular function can be executed. To provide some context, think o ...

Highlighting the current menu item by comparing the URL and ID

Looking to make my navigation menu items active based on URL and ID, rather than href. None of the suggested solutions (like this one, this one, or this one) have worked for me. This is how my Navigation is designed: <nav id="PageNavigation"& ...

Tips for positioning an element at the bottom of columns using bootstrap

I'm having trouble aligning an image to the bottom of the page. Despite the column being the same height, the image just won't align all the way to the bottom. https://i.sstatic.net/0u9LH.jpg Check out the Codepen demo for reference: https://co ...

When using angular's ngHide directive on a button, it will still occupy space in the

At the bottom of this HTML file, there are 3 buttons displayed. The first image illustrates the layout of the 3 buttons. The second image demonstrates what happens when the middle button in the footer is commented out. The third image shows the situat ...

Unexpected behavior with the background property in CSS

Visit the live webpage Searching for a solution to showcase code snippets on my site, I'm faced with a challenge as a CSS beginner. My struggle lies in creating a dark background for displaying these code snippets. Upon trying to implement a class n ...

Is there a way to command Chrome or Firefox to execute JavaScript or load a Bookmarklet directly from the command line?

Is there a way to execute javascript in the current browser window through the command line, either in Chrome or Firefox? Or is it possible to load a bookmarklet that includes javascript? I'm interested in creating a program that can monitor changes ...

When attempting to overlay CSS text onto an image, the text appears to be hiding behind the

Essentially, what I was attempting to do was overlay some text on top of an image on a website I'm creating. After researching online, I learned that I could achieve this by using position absolute and relative, which worked to some extent. However, n ...

Having trouble with table sorting in Jquery?

I am a beginner in the realm of Jquery and web programming. Recently, I attempted to implement the tablesorter jquery plugin for one of my projects but encountered issues with making it work properly. In search of a solution, I turned to Stack Overflow. C ...

Eliminate styling from text within an HTML document

I'm currently working on removing text decorations from my text. I managed to remove the underline, but when I hover over the text, the color still appears. How can I get rid of this color as well? Take a look at the code below: messbox { backgr ...

Guide on How to Include data (PDF Base 64) in angular 6 component

Within my Angular 6 application, I am presenting data (a report) in a new window using the following code snippet. *** The 'result' variable contains Base64 data *** if (result != null) { const pdfWindow = window.open(""); ...

Adjust the size of CSS boxes based on the window dimensions

I am facing an issue with two divs placed side by side. They appear fine when the page is viewed in full-screen mode. However, upon resizing the window, the right div overlaps the left one and causes a messy layout. . -I want to prevent these boxes fro ...

Div with see-through overlay area

I am attempting to create a visual effect on my webpage where there is a semi-transparent overlay covering all elements except for one specific div. Here is an illustration of the structure of my page: <div id="d1"> <div id="d2"></div& ...

Tips for creating the ultimate footer section on your webpage

I'm trying to position the footer div (id="Footer") 10px from the bottom of the screen. Regardless of whether the page content fills the entire height of the screen or creates a scroll area, I want the div to always be at the very bottom with a 10px m ...

The z-index property seems to be disregarded

I'm facing an issue with my navigation dropdown menu. I want the dropdown items to appear from behind the menu, but they always come from the top. I've tried adjusting the z-index but it doesn't work. I've checked similar problems onlin ...

Utilize a select box to toggle between enabling and disabling options

Could someone please help me with enabling and disabling a text field based on a select box option? I'm not sure if I have written the code correctly below. If there are any errors, please correct me. <body> <table width="500" border="1"> ...

The window.onload function is ineffective when implemented on a mail client

Within my original webpage, there is a script that I have created: <script> var marcoemail="aaaaaa"; function pippo(){ document.getElementById("marcoemailid").innerHTML=marcoemail; } window.onload = pippo; </script> The issue a ...

Learning to activate music on a webpage using the tab key in HTML

Is there a way to trigger the playback of an mp3 file when the tab key is pressed on a keyboard? I am designing a number system for a restaurant where entering a number and pressing tab will result in a noise being played to bring attention to the numbers ...