The issue of CSS3 Grid-gap not functioning properly on iPhone devices

I've been working on creating a CSS template and everything seems to be functioning correctly, except for the grid gap which doesn't seem to work properly on my iPhone. Here's the code I have so far:

<div class="grid">

        <h1 class="page-title">
            <?php echo $username; ?>
        </h1>

        <header class="header">
            Reviewed
            <?php
                $sql = $mysqli->query("SELECT `id` FROM `users` WHERE `username`='$username'");
                $result = $sql->fetch_assoc();
                $result = $result['id'];

                $sql = $mysqli->query("SELECT COUNT(rating) FROM `reviews` WHERE `userid`='$result'");
                $result = $sql->fetch_assoc();

                echo " " . $result['COUNT(rating)'] . " ";
                if ($result['COUNT(rating)'] == 1) {
                    echo "Movie";
                } else {
                    echo "Movies";
                }

            ?>
        </header>

            <main class="main-content">
                Test
            </main>

            <aside class="sidebar">
                Sidebar
            </aside>

        <footer class="footer">
            Footer
        </footer>
    </div>

CSS:

.grid {
margin: 15px;
display: grid;
grid-template-columns: 1fr 1fr;
grid-template-rows: 1fr 1fr 1fr 1fr 1fr;
grid-template-areas: 
"index-title index-title"
"index-header index-header"
"index-main-content index-main-content"
"index-sidebar index-sidebar"
"index-footer index-footer";
grid-gap: 10px;
}

.page-title {
grid-area: index-title;
text-align: center;
}

.header {
grid-area: index-header;
border: 1px black solid;
font-size: 20px;
text-align: center;
}

.main-content {
grid-area: index-main-content;
background-color: green;
}

.sidebar {
grid-area: index-sidebar;
background-color: yellow;
}

.footer {
grid-area: index-footer;
background-color: purple;
}

@media screen and (min-width: 1062px) {

.grid {
    margin: 15px;
    display: grid;
    grid-template-columns: 1fr 500px 500px 1fr;
    grid-template-rows: 1fr 1fr 2fr 1fr;
    grid-template-areas: 
    ". index-title index-title ."
    ". index-header index-header ."
    ". index-main-content index-sidebar ."
    " .index-footer index-footer .";
    grid-gap: 10px;
}
}

While the gap seems to work fine when I resize the page, it doesn't appear to function as expected on my iPhone SE. Any idea why this might be happening?

Your insights would be greatly appreciated.

Thank you in advance.

Answer №1

For more information on CSS grid compatibility, visit this page: (https://caniuse.com/#search=grid). Check out the "known issues" section to see Safari's lack of support for intrinsic and extrinsic sizing using grid properties like grid-template-rows:

According to caniuse.com, Safari does not currently support intrinsic and extrinsic sizing with grid properties such as grid-template-rows.

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

Ensure that the default value in the text box remains unchanged until new text is input by utilizing jQuery

Can you please review my code snippet on http://jsfiddle.net/7995m/? The issue I'm facing is that the default text in the text box disappears as soon as it's clicked. What I want is for the default text to remain until the user starts typing. Her ...

Can a Dashcode Webkit Web app be transformed into traditional HTML and CSS?

I have developed a blog using Dashcode, incorporating HTML, CSS, and Javascript to pull data from an xml file. It's pretty simple... My perspective on this is: 1. JavaScript should be compatible with all browsers (with some variations). 2. I may need ...

Hello there! I'm currently working on implementing a button that will alter the CSS grid layout

I need help designing a button that can alter the layout of my CSS grid. The grid information is contained within a class called 'container'. My goal is to change the grid layout by simply clicking a button, using either HTML and CSS or JavaScri ...

Incorporate a PowerPoint presentation into an Iframe

Can you confirm if this code is correct? Is there another way to achieve the same result? Could you please provide some assistance with the code? I would like to show my PowerPoint file in an iframe when I click on a link. <html> <head> < ...

What is the best way to generate an accordion populated with data from a MySQL query?

Everything is in order, I've got all the chapters and video series extracted without any issues: $id_course = 1; $stmt = $con->prepare("SELECT c.chapter, v.preview, v.title_video, ...

What is the process for using AJAX and PHP to upload an image file?

I'm facing an issue where I want to insert an uploaded image into a database with user details for a profile picture. The output I receive currently shows {"current_field":null,"field_count":null,"lengths":null,"num_rows":null,"type":null}. How can th ...

javascript cannot utilize html reset functionality

My drop down menu includes an onChange event that triggers a JavaScript method. However, when I select a new value and then click the reset button, the dropdown reverts back to its original value but the onChange event does not fire. <select onChange= ...

Showing a JavaScript variable on an HTML page

I have a challenge where I am attempting to showcase a variable using the code provided below: HTML: <div id="MyEdit">Money</div> JS: var price1 = 0; var current_value=document.getElementById("MyEdit").innerHTML; if (current_value == "msc" ...

Accessing the Bootstrap tab form from an external source

I currently have Bootstrap tabs on a page and they are functioning correctly. However, I am looking to open these tabs from an external page. Is this feasible? <div role="tabpanel"> <ul class="nav nav-tabs" role="tablist"> ...

Ways to customize the default CSS styles of angularJS for elements like search box and more

Looking for a way to customize the appearance of an AngularJs search box? <div ng-controller="PersonListCtrl"> <div class="bar">Search: <input ng-model="query"> </div> <ul cl ...

"The Zorro table is filled with items of various types, although unfortunately, the Intellisense is not as accurate as it

Imagine a scenario where you have a basic table set up: <nz-table #table [nzData]="users"> <thead> <tr> <th>Id</th> <th>First Name</th> <th>Last Name</th> </tr> ...

Why are there no borders around the rows and columns of my table?

I'm just starting to learn HTML so I appreciate your patience with what may be a basic question for some. After creating a table using , I've noticed that there are no visible lines separating the cells. Is there a way to add lines around the ce ...

I am attempting to extract data from the website by utilizing the correct CSS selectors, however, I continue to receive results suggesting that the element is not present

Struggling to create a bot for my own services, but encountering crashes when trying to run it. login_button = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.CSS_SELECTOR, "//div[@class='loginRegisterButtons sb- ...

Using Vue and vue-multiselect to create interactive options based on the selected language

I'm currently developing a Vue website with multilingual support. The chosen language is stored in a Vuex store and accessed through the computed property lang, like so: lang(){ return this.$store.state.lang } I use this lang property in v-if cond ...

Unable to utilize navigator.camera.getPicture in iOS while using PhoneGap Adobe Build

I've spent hours searching, trying to troubleshoot my PhoneGap app (compiled by Adobe PhoneGap Build) and I suspect there's something crucial about PhoneGap that I'm missing. I've added the following lines to the config.xml file: <f ...

Tips for creating a sidebar table of contents with CSS

I'm looking to design a webpage with a side bar table of contents (TOC) similar to the one found here: The current placement of the TOC on the HTML page is as follows: <h2>Table of Contents</h2> <div id="text-table-of-contents&quo ...

Tips for creating an element that maintains its dimensions when a border is added during a hover effect

One issue I often face is the desire to add a border to an element on hover, only to find that as the border appears, the element's height and width change, causing it to visually jump and potentially push other elements. Is there a solution for this ...

Creating a Piechart in Kendo UI that is bound to hierarchal remote data

I am facing an issue with binding remote data to a pie chart while managing a grid with dropdown sorting options. The grid is working fine, but I am unable to display the hierarchical data on the pie chart as categories. <!DOCTYPE html> <html> ...

Reducing the slide margins in impress.js?

When using Impress.js, I noticed that the default slides have a large left margin (or padding - it's hard to determine with Firefox's Inspector). I have a slide with a wide <pre> block that would fit if it were aligned to the left, but it d ...

"Drag and drop elements that automatically snap to a grid and move with

I'm trying to create a small, square div that follows the mouse cursor, but I want it to snap to a 3x3 pixel grid. Here is what I have so far: $(document).mousemove(function(e) { window.x = e.pageX; window.y = e.pageY; if(window.x % 9 === 0 ){ ...