使用 Django 框架时无法在 Bootstrap 中的行之间放置间距

我已经阅读了很多答案并尝试了他们的解决方案,但似乎没有任何效果。这是我的代码。我试过使用 mt-10、row-padding 和其他自定义 css 使用 margin-top:10。但没有任何效果。The image shows no space between rows using mt-10

{% block content %}
     {% for playlist,progress in user_playlists.items %}
                <div class="row justify-content-between rounded m-auto">
                    <div class="col-6 m-auto"><a> {{playlist}}</a></div>
                    <div class="col-6 m-auto"><a>{{ progress }}</a></div>
                </div>
    {% endfor %}
{% endblock %}

shenwenxia715 回答:使用 Django 框架时无法在 Bootstrap 中的行之间放置间距

您可以使用 mb-5 来完成此操作,而如果您认为有必要使用 m-auto,也许您可​​以为此使用内联样式。例如。

<div class="row justify-content-between rounded mb-5" style="margin-left:auto; margin-right:auto;">...</div>

style="margin-left:auto; margin-right:auto;" 将执行与 m-auto 相同的工作。

本文链接:https://www.f2er.com/27614.html

大家都在问