here is the html code of the buttons:
{% extends 'main/layout.html' %}
{% block content %}
<div class="features">
<h1>Главная страница</h1>
<div style="display: inline-block;" id="outer">
<form action="{% url 'about' %}">
<button class="btn btn-warning">На страницу про нас</button>
</form>
<form action="{% url 'data' %}">
<button class="btn btn-warning">На страницу данных</button>
</form>
</div>
</div>
{% endblock %}
{% block title %}Главная страница{% endblock %}
can you please explain in detail how to fix the problem!
2
Answers
You can do it by adding this in your css:
To address styling issues, start with the HTML and any styling you have:
Use your browser’s debugging tools to observe the styling rules being applied to your elements. In this case, the
<div>
withid="outer"
isinline-block
, so it doesn’t take up the full width. Remove that and see that happens (still in your browser’s debugging tools):Now that
<div>
takes up the full width, but so do the<form>
elements. You can make those beinline-block
:Which "works". But you may be able to do better. You can do a lot of things with CSS
flex
. For example, that<div>
can be a flex container:Then you can do what you like with that
flex
styling. Do you just want agap
between the<form>
elements? Do you want them to take up the full width with maximum space between? Something else? There are lots of options available. For a simple gap, for example:Or for full-width space: