Is there a solution to address the issue of Mobile Safari displaying CSS in a unique

My layout consists of two columns, with data on the left and navigation on the right. While it renders correctly on Safari desktop, Safari for iPhone displays the right column at the bottom of the page underneath the data. Here is the basic code template:

<body>
  <div class="colmask rightmenu">
    <div class="colleft">
      <div class="col1">
        <!-- Column 1 start -->
        <div class="ui-body ui-body-e">
          <div data-role="collapsible" data-collapsed="true" data-theme="e" data-content-theme="b">
            some data here
          </div>
        </div>
        <!-- Column 1 end -->
      </div>
      <div class="col2">
        <!-- Column 2 start -->
          <div class="ui-body ui-body-b">
            nav stuff here
          </div>
        <!-- Column 2 end -->
      </div>
    </div>
  </div>
</body>

The issue persists regardless of the viewport width being set to 100%.

Below is the CSS used:

body {
    margin:0;
    padding:0;
    border:0;
    width:100%;
    background:#fff;
    font-size:90%;
}

a {
  color:#369;
}

a:hover {
  color:#fff;
  background:#369;
  text-decoration:none;
}

h1, h2, h3 {
  margin:.8em 0 .2em 0;
  padding:0;
}

p {
  margin:.4em 0 .8em 0;
  padding:0;
}

<img {
  margin:10px 0 5px;
}

#ads img {
    display:block;
    padding-top:10px;
}

/* Styles for header */
#header {
  clear:both;
  float:left;
  width:100%;
}

#header {
  border-bottom:1px solid #000;
}

#header p,
#header h1,
#header h2 {
  padding:.4em 15px 0 15px;
  margin:0;
}

#header ul {
  clear:left;
  float:left;
  width:100%;
  list-style:none;
  margin:10px 0 0 0;
  padding:0;
}

#header ul li {
  display:inline;
  list-style:none;
  margin:0;
  padding:0;
}

#header ul li a {
  display:block;
  float:left;
  margin:0 0 0 1px;
  padding:3px 10px;
  text-align:center;
  background:#eee;
  color:#000;
  text-decoration:none;
  position:relative;
  left:15px;
  line-height:1.3em;
}

#header ul li a:hover {
  background:#369;
  color:#fff;
}

#header ul li a.active,
#header ul li a.active:hover {
  color:#fff;
  background:#000;
  font-weight:bold;
}

#header ul li a span {
  display:block;
}

/* 'Widths' sub menu */
#layoutdims {
  clear:both;
  background:#eee;
  border-top:4px solid #000;
  margin:0;
  padding:6px 15px !important;
  text-align:right;
}

/* Column container */
.colmask {
  position:relative; /* This fixes the IE7 overflow hidden bug */
  clear:both;
  float:left;
  width:100%; /* Width of whole page */
  overflow:hidden; /* This chops off any overhanging divs */
}

/* Common column settings */
.colright,
.colmid,
.colleft {
  float:left;
  width:100%;
  position:relative;
}

.col1,
.col2,
.col3 {
  float:left;
  position:relative;
  padding:0 0 1em 0;
  overflow:hidden;
}

/* 2 Column (right menu) settings */
.rightmenu {
  background:#eee; /* Right column background color */
}

.rightmenu .colleft {
  right:25%; /* Right column width */
  background:#fff; /* Left column background color */
}

.rightmenu .col1 {
  width:71%;
  left:27%; /* (Right column width) plus (Left column left padding) */
}

.rightmenu .col2 {
  width:21%;
  left:31%;
}

/* Footer styles */
#footer {
  clear:both;
  float:left;
  width:100%;
  border-top:1px solid #000;
}

#footer p {
  padding:10px;
  margin:0;
}

Answer №1

If you're encountering issues, it could be due to the difference in resolution settings between iPhones, iPod Touches, and generic computers.

For more information on iPod Touch, visit: http://en.wikipedia.org/wiki/IPod_Touch

And for details about iPhone, check out: http://en.wikipedia.org/wiki/IPhone

To ensure your CSS renders correctly on various screens, including mobile devices, it's crucial to configure your template to account for different resolutions.

Even if your layout is set at 100%, specific CSS settings may not be recognized by iPhones or iPod Touches, so troubleshooting these differences is essential.

I've been working on a design that caters to both traditional computers and Apple devices, and let me tell you, it's a challenging process. Crafting the script can take just 10 minutes, but refining it can consume anywhere from 30 minutes to two full days.

Consider exploring this resource for further assistance: Detect iPhone/iPad purely by CSS

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

Is it possible to apply CSS to the alert and confirm functions in Angular?

Currently, I am facing an issue with implementing CSS on elements that are nested inside a function. I am unsure of how to access them properly. For example: updateUser() { this.usersService.UpdateUser(this.user.id, this.user) .subscribe(() =& ...

Continuous scroll notification within the fixed menu until reaching the bottom

I'm looking to achieve a scrolling notification message that stays fixed at the bottom of a top-fixed menu while the body content continues to scroll normally. Here's an example in this fiddle: HTML: <div class="menu-fixed">I am a fixed me ...

Why is it that all the columns seem to be stacked into just one column?

I've encountered an issue while trying to slice an image using HTML/CSS. My form, which I want to display in 3 columns, instead appears in a single column. The only time it works as intended is when I place my form and another div in the command sect ...

Discover the method for obtaining a selected element in a bootstrap dropdown that is dynamically populated

Similar to the question asked on Stack Overflow about how to display the selected item in a Bootstrap button dropdown title, the difference here is that the dropdown list is populated through an ajax response. The issue arises when trying to handle click ...

What are some effective strategies for incorporating multiple Themes into an AngularJS project?

Currently, I am in the process of working on a project that involves utilizing AngularJS, UI Bootstrap, and Sass. The next step is to incorporate different themes that can be selected by the user. While I have successfully implemented the ability to apply ...

Guidelines for attaching successful data to an element using URL action including parameter

How can I utilize an AJAX call to retrieve a list of properties and then append one of the list items as a hyperlink with a post method to an Action controller in the MVC framework? success: function (data) { debugger; for (v ...

Placing content inside the primary div disrupts the structure of the HTML page

I have a sidebar and a navbar in my HTML file. That's all I have. My goal is to insert content into the main-content div, but when I do, it appears like this - https://i.sstatic.net/YFiFC.png I want my content to fill up the empty space. https://i. ...

Tips for inserting a footer at the bottom of every page during the conversion process from HTML to PDF

Could use some assistance with converting HTML into a PDF report. In particular, I want the footer to always appear at the bottom of the last page, even if there is minimal content on that page. Any suggestions? I've been utilizing the wkhtmltopdf to ...

Connect the scroll wheel and then proceed to scroll in the usual way

There are two div elements with a height and width of 100%. One has the CSS property top:0px, while the other has top 100%. I have implemented an animation that triggers when the mousewheel is used to scroll from one div to the other. The animation functi ...

Utilize Python and BeautifulSoup for parsing HTML with multiple tags and classes

I am currently attempting to navigate through a complex HTML structure. Here is the snippet of the HTML code: <div class="example one"> <ol class="example two"> <li class="example three"> My object ...

How can CKEditor ensure that there is a paragraph tag within a div element?

Working on my current CMS, I have the need to include some custom HTML (which is functioning as expected): var element = CKEDITOR.dom.element.createFromHtml("<div class='sidebar'>Edit Sidebar Text</div>"); The issue arises when atte ...

The CSS filter failed to function properly as the Chrome Inspector is displaying a strik

I recently encountered an issue with my website where I was trying to apply a CSS dropshadow effect to an item, but it just wasn't working. Upon inspecting the code in Chrome Inspector, I noticed a strike through on the rule (refer to screenshot). Eve ...

Stable element contained within a moving container

My content block has text that scrolls when it becomes too large. I'm trying to create an overlay div on top of this block, and I have implemented a solution in my example. I encountered issues where setting position: fixed for the overlay prevents i ...

Display a single video on an HTML page in sequential order

My webpage contains a video tag for playing online videos. Instead of just one, I have utilized two video tags. However, when attempting to play both videos simultaneously, they end up playing at the same time. I am seeking a solution where if I start pla ...

Invisibility of form data on new page - PHP and Javascript

I have a webpage with multiple hyperlinks. Each hyperlink should redirect the user to a new page with the URL sent as POST data. What I can do: 1. Open the new page successfully. The issue I'm facing: 1. On the new page, I cannot access the URL ...

CSS hover effects are malfunctioning

Having an issue with hover in CSS. Attempting to create a menu bar using saved PNG files, each file within its own div. When applying a class name and hover modifier, it only works on the first element. As the pointer moves to subsequent elements, they are ...

Adjust the path of an element as it decreases in size

Sorry for the weird title, but that's likely why I can't find the solution on my own. I'm experimenting with CSS animations and I want the form element to decrease in height from 100px -> 0, but I want it to collapse from the top to the ...

Padding in submit button value is essential for ensuring proper spacing and

Is there a way to adjust the padding of a submit button value? I have tried using text-align: right;, which works fine for aligning the text to the right. However, when I attempt to use padding-left: 25px;, the text remains centered instead of moving to t ...

What is the best way to arrange the second div in the second row, while the first and third div are displayed on the first row within the MUI appbar

I have 3 components in the appbar, 1. Logo 2. Search Input 3. Login Buttons When viewing on desktop, all three components will be in a single row as shown below https://i.stack.imgur.com/FYMEH.png Below is my code snippet: export default function NavBar ...

Using JQuery and Ajax, what is the best way to transfer information from a popup form to a PHP page?

I've noticed that my question has been asked a few times already, but I'm still struggling to get my code working. It seems like I'm using the same code as those solutions, so I can't figure out what's going wrong. Currently, I am ...