Quantcast
Channel: Active questions tagged html - Stack Overflow
Viewing all articles
Browse latest Browse all 73905

CSS/Django - Display block as if buttons are present

$
0
0

everyone. In my django I have 2 options:

enter image description here

enter image description here

I want to be list with admin/user always on the right, like in my second jpeg.

HTML:

<body>
            <div class="container2">
                <div class="butts">
                    <form action="{% url 'catalog:redir' %}" method="post">

                        <button class="butt" type="submit">
                            <p>
                                На главную
                            </p>
                        </button>
                    </form>
                    <div>
                        {% if author_list.1 %}
                        <div>
                        <form action="{% url 'catalog:author_delete' author_list.1.id %}" method="post">

                            <button class="butt" type="submit">
                                <p>
                                    Новая раздача
                                </p>
                            </button>
                        </form>
                      </div>  
                    </div>
                </div>
                {% endif %}
                <div class="voted-users">
                    {% if author_list|length == 0 %}
                    <p>Игра не началась</p>
                    {% else %}
                    {% if voted_list %}

                    </ul>
                    {% else %}
                    <p>Непроголосовавшие пользователи</p>
                    <ul>
                        {% for i in user_list %}
                        <p> {{ i }} <p>
                                {% endfor %}
                    </ul>
                    {% endif %}
                    {% endif %}
                </div>
            </div>
        </body>

CSS:

.butts {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-direction: column;
}

.butt {
  display: flex;
  align-items: center;
  justify-content: center;
}

.container2 {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
}

The page is done using flexbox. Don't have any idea. It looks, like if my IF doesnt work my second div gets into first div (voted users into butts), but in the other case it doesnt happen


Viewing all articles
Browse latest Browse all 73905

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>