gpt4 book ai didi

html - 背景图像在 chrome 中重复但在 safari 中不重复

转载 作者:太空宇宙 更新时间:2023-11-04 06:23:04 25 4
gpt4 key购买 nike

背景图像似乎在页面底部的 chrome 上重复出现,但这在 safari 中不会发生。

这是它在 safari 中的外观以及我希望它的外观: enter image description here

这是它在 chrome 上的样子: enter image description here

这是我为这张图片使用的 css 代码:

    <!-- 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 %}

编辑:问题似乎出在导航栏或其下方的行中。

背景图像/重复的切断从行的底部开始

最佳答案

尝试使用速记:

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;
}

关于html - 背景图像在 chrome 中重复但在 safari 中不重复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55306801/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com