【发布时间】:2021-03-15 05:46:24
【问题描述】:
在我的 Django 项目的一个 HTML 文件中,我有一个 div,其中包含一个用于图像的 col-6 和一个用于文本的 col-6。
{% if automotives %}
{% for automotive in automotives %}
<div class="row">
<div class="col-6 mb-4 mb-md-0 my-5 pl-5">
<h3 class="font-weight-bold">{{ automotive.title }}</h3>
<p class="text-muted">{{ automotive.description|safe }}</p>
</div>
<div class="col-6 mb-4 mb-md-0 my-5 pr-5">
<div class=" overlay z-depth-1-half">
<img src="{{ automotive.cover.url }}" class="img-fluid" alt="cover">
</div>
</div>
</div>
{% endfor %}
{% endif %}
我从数据库中读取了title 和description 和cover。
我想定期更改每一行中图像和文本的顺序。
我不知道该怎么做。而我对js或jquery了解不多。
感谢任何帮助。
【问题讨论】: