user8663491
user8663491

Reputation:

CSS3 Grid-gap not working on iphone

I am making a template using CSS, and everything is working fine but the grid gap isn't working on iPhone. This is what 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;
}
}

When I minimize the page, the gap is working, but when I check it on my iPhone SE, grid-gap isn't working? Why is that so?

I hope you can understand my question

Thanks in advance.

Upvotes: 5

Views: 10586

Answers (1)

Adriano
Adriano

Reputation: 3934

See this page (https://caniuse.com/#search=grid), go in the "known issues" and have a look at what it says about safari:

Safari does not yet support intrinsic and extrinsic sizing with grid properties such as grid-template-rows

Upvotes: 5

Related Questions