Answer the question
In order to leave comments, you need to log in
How to display posts horizontally?
Hello, I am writing a site in Python Django, the problem is that I am looping records from the database and they are all displayed as a line. I
used this code element but it does not work
CSS
.contents li{
display: inline;
}
<div class="contents">
{% block content %}
{% endblock %}
</div>
{% extends "main/wrapper.html" %}
{% block content %}
{% for film in posts %}
<li><a href="/{{film.id}}"><img src="static\image\moonlight.jpg" width="203" height="291"></a>
<h3>{{film.title}}</h3></li>
{% endfor %}
{% endblock %}
Answer the question
In order to leave comments, you need to log in
.contents {
display: flex;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question