Chrome displays a repeating background image properly, while Safari does not

On Google Chrome, there seems to be a repeating background image issue at the bottom of the page that does not occur in Safari.

Here is how it appears in Safari, which is how I want it to look: https://i.sstatic.net/gDYNp.png

And here is how it looks on Chrome: https://i.sstatic.net/wZhO2.png

This is the CSS code being used for the image:


            <!-- Used to extend the base html to this html page -->
            {% extends "updates/base.html" %}
            {% load static %}

            <!-- This is to load tags determine if user is a moderator, superuser, or if user's group == update.game -->
            {% load users_tags %}

            <!-- Put your CSS files here -->
            {% block styles %}
                <link rel="stylesheet" type="text/css" href="{% static 'updates/css/title_updates.css' %}">
                <style>
                    body {
                        background: url("{{ game.cover_display.url }}") no-repeat 0 3.5rem;
                        background-size: 100% auto;
                        -webkit-background-size: 100% auto;
                        -moz-background-size: 100% auto;
                        -o-background-size: 100% auto;
                    }
                </style>
            {% endblock styles %}

            <!-- Actual Content for the homepage goes here -->
            {% block content %}
        
                <!-- Game Navbar -->
                <nav class="navbar navbar-expand-lg navbar-dark bg-mygrey position">
                    <div class="navbar-collapse collapse w-100 order-1 order-md-0 dual-collapse2">
                        <ul class="navbar-nav mr-auto">
                            <li class="nav-item">
                                <a class="nav-link text-light" href="#">Updates</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link text-light" href="#">Bugs</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link text-light" href="#">Petitions</a>
                            </li>
                        </ul>
                    </div>
                    <div class="mx-auto order-0">
                        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target=".dual-collapse2">
                            <span class="navbar-toggler-icon"></span>
                        </button>
                    </div>
                    <div class="navbar-collapse collapse w-100 order-3 dual-collapse2">
                        <ul class="navbar-nav ml-auto">
                            <li class="nav-item">
                                <a class="nav-link text-primary" href="#">
                                    <i class="fab fa-twitter fa-lg"></i>
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link text-light" href="#">
                                    <i class="fab fa-reddit-alien fa-lg"></i>
                                </a>
                            </li>
                        </ul>
                    </div>
                </nav>
                <!-- End of Game Navbar -->

                <div class="bg-mygrey mb-5">
                    <div class="row mt-1 pl-3 pr-3 pt-3 pb-3">
                        <div class="col-md-3 text-center">
                            <img class="img-fluid" src="{{ game.cover.url }}" alt="{{ game.title }} Cover Image">
                        </div>
    
                        <div class="col-md-9">
                            <p class="text-light text-break">{{ game.description }}</p>
                    
                                <button class="btn btn-myblue dropdown-toggle" type="button" id="platform"
                                        data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                    Select platform
                                </button>
                                <div class="dropdown-menu" id="plat-form-options">
                                    {% for platform in game.platform.all %}
                                        <a class="dropdown-item"
                                                onclick="platFormSelect('{% url 'title-updates-ajax' slug=game.slug platform_id=platform.id %}', '{{ platform }}')">{{ platform }}</a>
                                    {% endfor %}
                                </div>
                    
                            {% if user.is_authenticated %}
                                {% if subscription_status %}
                                    <a href="{% url 'unsubscription' slug=game.slug %}" id="subscription"
                                       class="btn btn-myblue">
                                        Unsubscribe
                                    </a>
                                {% else %}
                                    <a href="{% url 'subscription' slug=game.slug %}" id="subscription" class="btn btn-myblue">
                                        Subscribe
                                    </a>
                                {% endif %}

                            {% endif %}
                            {% if request.user.is_superuser or user|is_group:game.title %}
                                <a class="btn btn-success" href="{% url 'update-create' %}" aria-label="Create">
                                    <i class="fas fa-plus" aria-hidden="true"></i>
                                </a>
                            {% else %}
                            {% endif %}
                        </div>
                    </div>
                    <div id="updates_data">
                    </div>
                </div>
                <script>
                    $(document).ready(function () {
                        if ($("#plat-form-options option").length > 0) {
                            $("#plat-form-options option")[0].click();
                        }

                    });


                    function platFormSelect(url, platform) {
                        $('#platform').text(platform);


                        $.get(url, function (response) {
                            $('#updates_data').html(response);

                        })
                            .done(function () {

                            })
                            .fail(function () {

                            });

                    }
                </script>

            {% endblock content %}
    

Edit: The issue may be related to either the navbar or the row below it.

The cutoff of the background image/repeat appears at the bottom of the row.

Answer №1

Consider using shorthand notation:

body {
            background: url("{{ game.cover_display.url }}") no-repeat 0 3.5rem;
            background-size: 100% auto;
            -webkit-background-size: 100% auto;
            -moz-background-size: 100% auto;
            -o-background-size: 100% auto;
        }

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

The Radio button and Checkbox values are causing an issue where the Radio button is continuously summing upon clicking without a limit. Why is this happening? Check out

I'm currently stuck in a function and believe it would be helpful for you to guide me along the correct path. My goal is to sum the values of checked boxes with the values of checked radio buttons. However, the radio values are continuously accumulat ...

Display a CSS box continuously

I have a code for a dropdown function that is working smoothly. Now I would like the comment box to show permanently when clicked and close when clicked outside of it. Currently, when I click on the comment, the box shows up but if I try to input a commen ...

The Wordpress theme is malfunctioning when accessed on the internet

After successfully installing WordPress and a theme, customizing it on my localhost, everything appears to be working fine on the PC where XAMPP is installed. However, when attempting to access the same page from another PC on the network, there seems to ...

What steps should I follow to make a dynamic carousel card with Bootstrap that adjusts to different screen sizes

My goal was to design a Bootstrap card with an embedded 'slideshow'. The idea was to use the second page to provide more information about the content on the first page. While editing this on the web, I managed to create a satisfactory product () ...

Expanding Items' Widths in ItemsControl on Silverlight

I am facing an issue with my ItemsControl where the child items are not occupying the whole width of the control: My goal is to stretch the green bits to fill the width of the control, similar to how the blue bits are shown. I have attempted adjusting th ...

What is the best way to assign an identifier to a variable in this scenario?

script.js $('a').click(function(){ var page = $(this).attr('href'); $("#content").load(page); return false; }); main.html <nav> <a href="home.html">Home</a> <a href="about.html">About</a> < ...

Unable to retrieve information from the HTML form and pass it to the PHP script

I've got this code snippet in my index.html file: <html> <head> <title>Login</title> </head> <body> <h2>Admin Panel</h2> <FORM NAME ="form1" METHOD ="POST" ACTION = "login.php"> <INPUT TYPE = ...

Conditionals causing issue with React Button disabled property functionality

Having a DIV with two child elements, namely buttons that should be disabled under certain conditions. Despite correct conditions being applied, the buttons remain enabled which is causing confusion. The code snippet in question is as below : < di ...

I'm having trouble getting this text to align properly next to the image. Plus, I can't seem to achieve a horizontal screen alignment either

There seems to be an answer available, but I'm clearly not understanding it, so I've come here seeking further explanation and assistance. CSS can be quite complex, right? Here's a screenshot of my current project: https://i.stack.imgur.com/ ...

What is the best way to extract the name from JSON data?

I have a list of items in my HTML with data attributes. When a user clicks on one of the items, I want to display or append a list of related suburbs for that selected item in another list. This is being achieved using ajax. <ul id="cities"> <l ...

Customize the background color of a clipPath in SVG

I'm looking to design a landing page featuring a colored div with a clip-path, intended to showcase a video playing in the background. However, I'm encountering an issue where the background looks grayish without any clear explanation. Despite t ...

Can someone explain why the min-width property is not being respected by the <input> element?

Visit this link for the code The text field in the provided link should only be 10px wide but it is currently displaying a width of 152px. Here is the code snippet: .input { width: 100%; box-sizing: border-box; } .cont { padding: 2px; } .main ...

What is the best way to split a div diagonally while keeping the border unchanged?

I'm attempting to devise the design displayed in the link below: https://i.sstatic.net/n0ZbB.png I have experimented with the following code: .App { font-family: sans-serif; text-align: center; } #container { height: 300px; width: 300p ...

Uploading profile photos via PHP and storing in a database

I am encountering an issue where the uploaded photo appears on the site but its corresponding name is not being saved in the database. The code successfully uploads the photo to the site but unfortunately, the file name is not being stored in the database. ...

Tips for displaying a setCustomValidity message or tooltip without needing to submit the event

Currently, I am utilizing basic form validation to ensure that the email entered is in the correct format. Once validated, the data is sent via Ajax for further processing. During this process, I also check if the email address is already in use and whethe ...

Tips on how to align a wrapper-div in the center without affecting the positioning of the

I am looking to keep my page perfectly centered in the browser without affecting the content (similar to how align-text: center works). Specifically, I want to center my wrapper-div. How can I achieve this? Here is a simplified version of my current page ...

Text styling in HTML using a gradient effect

In the game LoR, players have the ability to edit their deck names using HTML code. As someone with no experience in HTML, I've noticed some players with gradient deck names and I'm struggling to figure out how they achieved this effect. The prob ...

The design features an Ionic grid with two columns: the left column is fixed in place, while the right column is

I seem to be struggling to locate proper documentation on the functionality of this feature. My main objective is to modify the code below so that the left column remains fixed (or potentially scrolls independently) while the right column scrolls. This p ...

Encountered an error when trying to open the bootstrap dropdown within ng-grid/ui

Is there a way to trigger the opening of a bootstrap-dropdown by clicking on a cell within ng-grid? I am currently only able to open it partially. Check out this Plunker link ...

Is it possible to achieve a seamless change using show/hide jQuery functions when hovering over an

How can I achieve smooth transitions when using an image map to show a div on hover, similar to the functionality seen on this website: ? Below is my current JavaScript code: var mapObject = { hover : function(area, event) { var id = area.attr ...