Various Mobile Devices Display Website in Unique Ways

I've been having trouble getting my website to display consistently across different phones and could use some assistance. You can view the site at www.fpphotos.store. I have set overflow-x:auto; for the table containing the images, with CSS styles defining their width as 100% and max width of 400px. However, these settings do not seem to work on the iPhone 13, while they display fine on an iPhone 15.

https://i.sstatic.net/LX4Xxm.jpg https://i.sstatic.net/kghyrm.jpg

After trying various approaches like using overflow-x: auto; and setting image widths to 100% and max-width to 400px, the issue persists on the iPhone 13.

p.tnc {
  text-align: center;
  color: lightcyan;
  background-color: #684c00;
  padding: 3ch;
  margin-top: 0cap;
  font-size: large;
  font-family: Verdana;
}

h1 {
  text-align: left;
  color: lightcyan;
  background-color: #684c00;
  padding: 1ch;
  margin: 0cap;
  font-size: x-large;
  font-family: Verdana;
}

h2 {
  text-align: center;
  font: bold;
  color: lightcyan;
  background-color: #684c00;
  padding: 1ch;
  margin: 0cap;
  font-size: xx-large;
  font-family: Verdana;
}

p {
  color: black;
  font-size: medium;
  font-family: Verdana;
  font: bold;
  text-align: center;
}

a {
  text-decoration: none;
}

.info {
  text-align: left;
  color: lightcyan;
  background-color: #684c00;
  padding: 3ch;
  margin-bottom: 0cap;
  font-size: medium;
  font-family: Verdana;
  list-style-type: lower-greek;
  text-decoration: none;
}

.contact {
  color: lightcyan;
}
<!DOCTYPE html>
<html>

<head>
  <link rel="icon" href="Original/angrywaspicon.png">
  <link href="fpphotos.css" rel="stylesheet" />
  <meta charset='utf-8'>
  <meta http-equiv='X-UA-Compatible' content='IE=edge'>
  <title>FP PHOTOS</title>
  <meta name='viewport' content='width=device-width, initial-scale=1'>
  <link rel='stylesheet' type='text/css' media='screen' href='main.css'>
  <script src='main.js'></script>
</head>

<body>
  <h1>FP Photos</h1>
  <h2>Photo Options</h2>
  <p class="tnc">ALL IMAGES ARE $6 AND COME IN 6x4 GLOSSY PHOTO PRINTS <br>Free Shipping on All Orders!</p>
  <div style="overflow-x: auto;">
    <table style="width:100%;">
      <tr>
        <td><a href="aw.html"><img style="width="100%" src="/Original/Angry Wasp - Copy.jpg"></td></a>
          <td><a href="gl.html"><img style="width="100%" src="/Original/DSC_0088.JPG"></td></a>
            <td><a href="dl.html"><img style="width="100%" src="/Original/DSC_0211.JPG"></td></a>
              <td><a href="wg.html"><img style="width="100%" src="/Original/DSC_0240.JPG"></td></a>
      </tr>
      <tr>
        <td>
          <p>Angry Wasp</p>
        </td>
        <td>
          <p>Grass Lizard</p>
        </td>
        <td>
          <p>Diamond Lizard</p>
        </td>
        <td>
          <p>Whispering Geckos</p>
        </td>
      </tr>
    </table>
  </div>
  ...
  (remaining HTML code removed for brevity)
</body>

</html>

Answer №1

When transitioning from a laptop to a PC, I encountered a similar issue. One solution you could try is changing the size options from percentages to pixels. If that doesn't resolve the problem, it may be due to differences in screen sizes. In such cases, creating a script that adapts to various screen sizes could be beneficial.

For assistance on detecting screen size using JavaScript, check out How to detect screen size with js

You can then adjust the elements based on device specifications and calculate the appropriate sizes. For example, by comparing different phone resolutions and element sizes, you can determine the correct dimensions for each device. Remember to round off any calculations involving sub-pixels.

I hope these suggestions prove helpful!

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

What method would you recommend for modifying HTML text that has already been loaded using JSP?

Is there a way to update text on an HTML document without reloading the entire page? I'm looking to create a simple "cart" functionality with 5 links on a page. When a link is clicked, I want it to increment the "items in cart" counter displayed on th ...

The X path and CSS selector for a particular table will vary on every page

Hello, I am new to HTML and currently working on a project that involves scraping data from html tables using RSelenium. I have managed to use the following code successfully: for(i in 1:50){ remDR$navigate(URLs[i]) CPSHList[[i]] <- remDR$getPageSou ...

Instructions on integrating a column of buttons into a Bootstrap table containing information retrieved from a MySQL database

My bootstrap table is currently displaying data that is loaded from a MySQL database. I am looking to enhance it by adding a column with buttons, similar to the layout shown in this image. https://i.stack.imgur.com/8fWfR.png However, I am facing some dif ...

Is the DOMContentLoaded event connected to the creation of the DOM tree or the rendering tree?

After profiling my app, I noticed that the event is triggered after 1.5 seconds, but the first pixels appear on the screen much later. It seems like the event may only relate to DOM tree construction. However, this tutorial has left me feeling slightly con ...

Creating an image in JavaScript from PNG data

Sorry if this is a basic question, but I'm still learning about working with images. I have a PHP script that generates a PNG image. The final two lines of the script are header('Content-Type: image/png'); imagepng($image); I am trying to ...

Display a section of the picture at maximum width

Can anyone help with displaying only a portion of an image at full width (100%) without any overflow issues? The code I've tried is not working: .intro_sea { position: absolute; width: 101%; clip-path: inset(30% 50% 0 0); margin: 0; paddi ...

Change the color of the navbar when scrolling using bootstrap and jquery

Using Bootstrap to design a navigation bar, I have two main goals: I want the navbar to change color when the page is scrolled down by 20%, and then revert back to its original color when scrolling back to the top. When the collapse featu ...

Make sure PTable maintains a horizontal layout on any device with PrimeNG

When I view my Ptable on desktop or iPad, it looks like this: https://i.stack.imgur.com/ONqZV.png However, when I switch to a device like an iPhone X, it changes to this layout: https://i.stack.imgur.com/H2q7j.png I want the horizontal layout to displa ...

Newbie inquiries regarding the process of migrating a CRUD application to PhalconPHP

I have recently delved into using PhalconPHP 1.3.1 for an application related to my master's thesis. While it is still a work in progress, I am currently focusing on implementing CRUD functionality and refining the user interface. This endeavor marks ...

Tips for enhancing redundancy in HTML and ROR using partials

Looking for a way to merge two partials in my Ruby on Rails app without copy-pasting. Here's what I'm aiming for: @member = 'Player' render 'team/team_partial' @member = 'Staff' render 'team/team_partial&a ...

CSS3 Animation: Facing issue with forwards fill behavior in Safari when using position and display properties

After creating a CSS3 animation to fade out an element by adjusting its opacity from 1 to 0 and changing the position to absolute and display to none in the last frames, I encountered an issue. In Safari, only the opacity is maintained while the position a ...

The enigmatic "margin-30" element within adaptable layout design

Recently, I decided to challenge myself by learning pure CSS and moving away from relying on Bootstrap for my layouts. The only aspect of Bootstrap I really used was the container class, so I created a basic project to experiment with pure CSS. In this pro ...

What could be causing issues with the JQuery .Resize() function?

I'm attempting to create a responsive layout where the content div adjusts itself when the user resizes the page. The top and bottom divs are static, so only the content div changes its size based on the page flow. $(window).resize(function() { v ...

The styles are not being successfully applied to the Material UI Menu component within a React application

I recently started working with material-UI. I have a menu component that looks like this: <Menu classes={{ paper: css.paperMenu }} className={classNames({ [css.menuMarginTop]: true })} > .menuMarginTop { margin-top: 14px; } In ...

The Iframe contains its own scroll feature within the body

I am facing an issue with displaying an Iframe inside a modal. The challenge is that the content within the Iframe varies in height, making it difficult to set a fixed height for the Iframe itself. When I try setting the height to 100%, the result is a 150 ...

How to make text in HTML and CSS stay at the bottom of a div?

I am in the process of creating a website dedicated to my "Starcraft II" clan. My goal is to have the navigation bar display the text "ALLOYE" and remain fixed at the bottom of the screen. I attempted to achieve this using the following code: vertical-alig ...

Clicking on a JQuery dropdown menu will always result in it staying open

After creating a dropdown menu click, I noticed some strange behavior. When I click the dropdown button, the menu appears as expected. However, if I move my cursor away without clicking the button again, the dropdown menu disappears and behaves like a hove ...

Tips for limiting a website to load exclusively within an iframe

I am managing two different websites: https://exampleiframe.com (a third-party website), https://example.com (my own website) My goal is to limit the loading of https://example.com so that it only opens within an iframe on https://exampleiframe.com To a ...

Picture in the form of a radio button

Is there a way to use an image instead of a radio button in my AngularJS form? I have managed to hide the radio button using CSS, but it disables the checked event. How can I make the image clickable? position: absolute; left: -9999px; Here is the code s ...

What is the best method to restrict the size of a div to match the dimensions of the

In my webpage, I have a menubar (div) that contains bookmarks. However, when too many bookmarks are added, the menu becomes too wide for the page size I prefer (1280, 720) and becomes scrollable, causing some bookmarks to be out of view. My goal is to ens ...