I am brand new to front end and am practising by building a fake e-commerce website. I've had a few issues but ran into one where I am not sure the best way to solve them. I would like my form to be centred in the middle of the page. The reason why it is complicated is because I had an issue where my viewport was too large due to the lack of content on the page itself, there was a huge white space under my footer. My way of solving this was just simply making the view height of the form itself be 85%, because of this I am not sure how to centre my form horizontally on the page. What would be the best way to solve this issue? Any help is greatly appreciated! Attached will be a screenshot and the code
code is as follows:
{% extends 'base.html' %}
{% load static %}
{% block css_files %}
<link rel="stylesheet" href="{% static 'login-out.css' %}">
{% endblock %}
{% block content %}
<div class="container-fluid" id='loginout'>
<div class="container-fluid text-center pt-3">
{% if next %}
{% if user.is_authenticated %}
<p>Your account doesn't have access to this page. To proceed,
please login with an account that has access.</p>
{% else %}
<p><strong> Please login to see this page.</strong></p>
{% endif %}
{% endif %}
</div>
<section id="form-test">
<div class="container w-25 py-3" id='login-wrapper'>
<form method="post" action="{% url 'login' %}">
{% csrf_token %}
<div class="form-group">
{{ form.username.label_tag }}
{{ form.username }}
{{ form.password.label_tag }}
{{ form.password }}
{{ form.non_field_errors }}
</div>
<input class='btn btn-outline-primary' type="submit" value="Login" />
<input type="hidden" name="next" value="{{ next }}" />
</form>
{# Assumes setup the password_reset view in URLconf #}
<p><a href="{% url 'password_reset' %}">Lost password?</a></p>
</div>
</section>
</div>
{% endblock %}
and css
#loginout {
background: #fef8f5;
height: 85vh;
}
#container-text-center-pt-3 a {
text-decoration: none !important;
}
#wrapper {
background: #fef8f5;
height: 100vh;
}
.form-control:focus {
border-color: #d66534;
box-shadow: 0 0 0 0.2rem rgb(230, 77, 11, 0.25);
}
#login-wrapper {
background-color: white;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}